Rustify core/src/core (#1122)
Small refactoring of one folder, if it makes sense I could extend the scope. * Remove some cloning (real and just verbosity in the code) * Naming conventions like to/into* * Some Clippy's suggestions I found that we don't use field init shorthand syntax, so I didn't touch this part, was it discussed before?
This commit is contained in:
@@ -221,7 +221,7 @@ where
|
||||
let diff_sum = diff_data
|
||||
.iter()
|
||||
.skip(MEDIAN_TIME_WINDOW as usize)
|
||||
.fold(0, |sum, d| sum + d.clone().unwrap().1.into_num());
|
||||
.fold(0, |sum, d| sum + d.clone().unwrap().1.to_num());
|
||||
|
||||
// Apply dampening except when difficulty is near 1
|
||||
let ts_damp = if diff_sum < DAMP_FACTOR * DIFFICULTY_ADJUST_WINDOW {
|
||||
|
||||
Reference in New Issue
Block a user