Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Sjoerd Simons <sjoerd@collabora.com>
  • Loading branch information
sjoerdsimons committed Feb 24, 2024
1 parent 497588d commit e4479a4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bmap-parser/src/discarder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ mod test {
.iter()
.fold(0, |pos, offset| {
let mut byte: u8 = 1;
discarder.seek_forward((offset - pos) as u64).unwrap();
discarder.seek_forward(offset - pos).unwrap();
assert_eq!(1, discarder.read(slice::from_mut(&mut byte)).unwrap());
assert_eq!(*offset, byte as u64);
*offset + 1
Expand Down
6 changes: 4 additions & 2 deletions bmap-parser/tests/copy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,16 @@ fn setup_data(basename: &str) -> (Bmap, impl Read + SeekForward) {
let mut bmapfile = datadir.clone();
bmapfile.push(format!("{}.bmap", basename));

let mut b = File::open(&bmapfile).expect(&format!("Failed to open bmap file:{:?}", bmapfile));
let mut b =
File::open(&bmapfile).unwrap_or_else(|_| panic!("Failed to open bmap file:{:?}", bmapfile));
let mut xml = String::new();
b.read_to_string(&mut xml).unwrap();
let bmap = Bmap::from_xml(&xml).unwrap();

let mut datafile = datadir.clone();
datafile.push(format!("{}.gz", basename));
let g = File::open(&datafile).expect(&format!("Failed to open data file:{:?}", datafile));
let g =
File::open(&datafile).unwrap_or_else(|_| panic!("Failed to open data file:{:?}", datafile));
let gz = GzDecoder::new(g);
let gz = Discarder::new(gz);

Expand Down

0 comments on commit e4479a4

Please sign in to comment.