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