Skip to content

Commit

Permalink
Merge branch 'development' of github.com:tari-project/randomx-rs into…
Browse files Browse the repository at this point in the history
… ci-leet-modernise
  • Loading branch information
leet4tari committed Dec 11, 2023
2 parents 82314cc + ea8669d commit ba6ee18
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion lints.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ deny = [
'clippy::enum_glob_use',
# This is 99% not needed
'clippy::inline_always',
'clippy::let_underscore_drop',
'let_underscore_drop',
'clippy::let_unit_value',
'clippy::match_on_vec_items',
'clippy::match_wild_err_arm',
Expand Down Expand Up @@ -62,4 +62,6 @@ allow = [
# Generally when developers fix this, it can lead to leaky abstractions or worse, so
# too many arguments is generally the lesser of two evils
'clippy::too_many_arguments',
# we get this inside of the macro, which we cannot ignore there
'clippy::bad_bit_mask'
]
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ mod tests {
let dataset = RandomXDataset::new(flags, cache.clone(), 0).unwrap();
let memory = dataset.get_data().unwrap_or_else(|_| std::vec::Vec::new());
assert!(!memory.is_empty(), "Failed to get dataset memory");
let vec = vec![0u8; memory.len() as usize];
let vec = vec![0u8; memory.len()];
assert_ne!(memory, vec);
drop(dataset);
drop(cache);
Expand All @@ -537,7 +537,7 @@ mod tests {
let cache1 = RandomXCache::new(flags, key.as_bytes()).unwrap();
let mut vm1 = RandomXVM::new(flags, Some(cache1.clone()), None).unwrap();
let hash1 = vm1.calculate_hash(input.as_bytes()).expect("no data");
let vec = vec![0u8; hash1.len() as usize];
let vec = vec![0u8; hash1.len()];
assert_ne!(hash1, vec);
let reinit_cache = vm1.reinit_cache(cache1.clone());
assert!(reinit_cache.is_ok());
Expand Down Expand Up @@ -589,7 +589,7 @@ mod tests {
assert_eq!(inputs.len(), hashes.len());
let mut prev_hash = Vec::new();
for (i, hash) in hashes.into_iter().enumerate() {
let vec = vec![0u8; hash.len() as usize];
let vec = vec![0u8; hash.len()];
assert_ne!(hash, vec);
assert_ne!(hash, prev_hash);
let compare = vm.calculate_hash(inputs[i]).unwrap(); // sanity check
Expand Down

0 comments on commit ba6ee18

Please sign in to comment.