Skip to content

Commit

Permalink
Fix Clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
repi committed Oct 21, 2023
1 parent 2daa8bc commit 379eb50
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion test-compress/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![allow(unused_imports)]
#![allow(unused_imports, clippy::type_complexity)]

use rayon::prelude::*;
use std::{
Expand Down
11 changes: 5 additions & 6 deletions test-hash/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ fn hashes() -> Vec<(&'static str, &'static str, Box<dyn Fn(&[u8]) -> Vec<u8> + S
// md-5
( "md-5", "MD5", Box::new(|b| {
let mut hasher = md5_alt::Md5::new();
hasher.update(&b);
hasher.update(b);
hasher.finalize().to_vec()
}) ),

Expand Down Expand Up @@ -154,7 +154,7 @@ fn hashes() -> Vec<(&'static str, &'static str, Box<dyn Fn(&[u8]) -> Vec<u8> + S
Box::new(|b| {
use blake2::digest::{VariableOutputDirty, Update};
let mut hasher = blake2::VarBlake2b::new(32).unwrap();
hasher.update(&b);
hasher.update(b);
let mut t = vec![];
hasher.finalize_variable_dirty(|res| t = res.to_vec());
t
Expand Down Expand Up @@ -200,8 +200,8 @@ fn hashes() -> Vec<(&'static str, &'static str, Box<dyn Fn(&[u8]) -> Vec<u8> + S
})
),

( "bao", "bao-combined", Box::new(|b| bao::encode::encode(&b).1.as_bytes().to_vec()) ),
( "bao", "bao-outboard", Box::new(|b| bao::encode::outboard(&b).1.as_bytes().to_vec()) ),
( "bao", "bao-combined", Box::new(|b| bao::encode::encode(b).1.as_bytes().to_vec()) ),
( "bao", "bao-outboard", Box::new(|b| bao::encode::outboard(b).1.as_bytes().to_vec()) ),

// multihash

Expand Down Expand Up @@ -316,8 +316,7 @@ fn perf_test(options: Options) {
.build_global()
.unwrap();

let mut bytes = Vec::new();
bytes.resize(options.size * 1024 * 1024, 0u8);
let bytes = vec![0u8; options.size * 1024 * 1024];

if options.format == Format::Csv {
println!("implementation,hash,MB/s");
Expand Down

0 comments on commit 379eb50

Please sign in to comment.