clippy: use rewind instead of seek 0

This commit is contained in:
Louis Dureuil 2023-01-31 10:14:19 +01:00
parent 07603373f3
commit 771a367b97
No known key found for this signature in database
2 changed files with 4 additions and 4 deletions

View file

@ -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<Box<dyn Iterator<Item = Result<Key>> + '_>> {
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?)?) }),
))