2023-04-20 09:37:15 -05:00
|
|
|
//@run-rustfix
|
2022-10-24 22:26:06 -05:00
|
|
|
#![warn(clippy::seek_from_current)]
|
|
|
|
|
|
|
|
use std::fs::File;
|
|
|
|
use std::io::{self, Seek, SeekFrom, Write};
|
|
|
|
|
2022-11-19 06:50:02 -06:00
|
|
|
#[clippy::msrv = "1.50"]
|
2022-10-24 22:26:06 -05: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 06:50:02 -06:00
|
|
|
#[clippy::msrv = "1.51"]
|
2022-10-24 22:26:06 -05:00
|
|
|
fn _msrv_1_51() -> 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(())
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|