2022-10-25 03:26:06 +00:00
|
|
|
#![warn(clippy::seek_from_current)]
|
|
|
|
|
|
|
|
use std::fs::File;
|
|
|
|
use std::io::{self, Seek, SeekFrom, Write};
|
|
|
|
|
2022-11-19 12:50:02 +00:00
|
|
|
#[clippy::msrv = "1.50"]
|
2022-10-25 03:26:06 +00:00
|
|
|
fn _msrv_1_50() -> io::Result<()> {
|
|
|
|
let mut f = File::create("foo.txt")?;
|
|
|
|
f.write_all(b"Hi!")?;
|
|
|
|
f.seek(SeekFrom::Current(0))?;
|
|
|
|
f.seek(SeekFrom::Current(1))?;
|
|
|
|
Ok(())
|
|
|
|
}
|
|
|
|
|
2022-11-19 12:50:02 +00:00
|
|
|
#[clippy::msrv = "1.51"]
|
2022-10-25 03:26:06 +00:00
|
|
|
fn _msrv_1_51() -> io::Result<()> {
|
|
|
|
let mut f = File::create("foo.txt")?;
|
|
|
|
f.write_all(b"Hi!")?;
|
|
|
|
f.stream_position()?;
|
|
|
|
f.seek(SeekFrom::Current(1))?;
|
|
|
|
Ok(())
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|