2023-04-23 06:03:09 -05:00
|
|
|
//@run-rustfix
|
2022-11-21 13:34:47 -06:00
|
|
|
#![warn(clippy::seek_from_current)]
|
|
|
|
|
|
|
|
use std::fs::File;
|
|
|
|
use std::io::{self, Seek, SeekFrom, Write};
|
|
|
|
|
2022-12-01 11:29:38 -06:00
|
|
|
#[clippy::msrv = "1.50"]
|
2022-11-21 13:34:47 -06: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-12-01 11:29:38 -06:00
|
|
|
#[clippy::msrv = "1.51"]
|
2022-11-21 13:34:47 -06: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() {}
|