stream_position(..)
RS-W1109The Seek
trait provides the Seek::stream_position(&mut self)
method, which is functionally
identical to Self::seek(&mut self, SeekFrom::Current(0))
. Consider avoiding the reimplementation.
fn foo() -> io::Result<()> {
let mut f = File::create("foo.txt")?;
f.write_all(b"Hello")?;
eprintln!("Written {} bytes", f.seek(SeekFrom::Current(0))?);
}
fn foo() -> io::Result<()> {
let mut f = File::create("foo.txt")?;
f.write_all(b"Hello")?;
eprintln!("Written {} bytes", f.stream_position()?);
}