From 771a367b978c55368dac48712d3c3af0af6ef987 Mon Sep 17 00:00:00 2001 From: Louis Dureuil Date: Tue, 31 Jan 2023 10:14:19 +0100 Subject: [PATCH] clippy: use rewind instead of seek 0 --- dump/src/lib.rs | 4 ++-- dump/src/reader/v5/mod.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dump/src/lib.rs b/dump/src/lib.rs index 7a7b9a5b7..6ca3e000e 100644 --- a/dump/src/lib.rs +++ b/dump/src/lib.rs @@ -198,7 +198,7 @@ impl From for KindDump { #[cfg(test)] pub(crate) mod test { use std::fs::File; - use std::io::{Seek, SeekFrom}; + use std::io::Seek; use std::str::FromStr; use big_s::S; @@ -410,7 +410,7 @@ pub(crate) mod test { // create the dump let mut file = tempfile::tempfile().unwrap(); dump.persist_to(&mut file).unwrap(); - file.seek(SeekFrom::Start(0)).unwrap(); + file.rewind().unwrap(); file } diff --git a/dump/src/reader/v5/mod.rs b/dump/src/reader/v5/mod.rs index 35bdcb453..3a22ca0a9 100644 --- a/dump/src/reader/v5/mod.rs +++ b/dump/src/reader/v5/mod.rs @@ -33,7 +33,7 @@ //! use std::fs::{self, File}; -use std::io::{BufRead, BufReader, ErrorKind, Seek, SeekFrom}; +use std::io::{BufRead, BufReader, ErrorKind, Seek}; use std::path::Path; use serde::{Deserialize, Serialize}; @@ -178,7 +178,7 @@ impl V5Reader { } pub fn keys(&mut self) -> Result> + '_>> { - self.keys.seek(SeekFrom::Start(0))?; + self.keys.rewind()?; Ok(Box::new( (&mut self.keys).lines().map(|line| -> Result<_> { Ok(serde_json::from_str(&line?)?) }), ))