Skip to content

Commit be21bef

Browse files
committed
get rid of the Wrapping wrapper.
1 parent b70e55b commit be21bef

File tree

2 files changed

+6
-17
lines changed

2 files changed

+6
-17
lines changed

testing/calibration/contract/fil-gas-calibration-actor/src/lib.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use std::num::Wrapping;
2-
31
// Copyright 2021-2023 Protocol Labs
42
// SPDX-License-Identifier: Apache-2.0, MIT
53
use anyhow::{anyhow, Result};
@@ -348,12 +346,12 @@ fn random_ascii_string(n: usize, seed: u64) -> String {
348346
/// Knuth's quick and dirty random number generator.
349347
/// https://en.wikipedia.org/wiki/Linear_congruential_generator
350348
fn lcg64(initial_seed: u64) -> impl Iterator<Item = u64> {
351-
let a = 6364136223846793005;
352-
let c = 1442695040888963407;
353-
let mut seed = Wrapping(initial_seed);
349+
let a = 6364136223846793005 as u64;
350+
let c = 1442695040888963407 as u64;
351+
let mut seed = initial_seed;
354352
std::iter::repeat_with(move || {
355-
seed = Wrapping(a) * seed + Wrapping(c);
356-
seed.0
353+
seed = a.wrapping_mul(seed).wrapping_add(c);
354+
seed
357355
})
358356
}
359357

testing/calibration/src/bin/on_event_evm_shapes.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ fn main() {
4343
// Estimated length of the CBOR payload (confirmed with observations)
4444
// 1 is the list header; 5 per entry CBOR overhead + flags.
4545
let len = 1
46-
+ (entry_count - 1 * value_size)
46+
+ ((entry_count - 1) * value_size)
4747
+ last_entry_value_size
4848
+ entry_count * key_size
4949
+ entry_count * 5;
@@ -61,13 +61,4 @@ fn main() {
6161
};
6262
}
6363
}
64-
65-
for (obs, name) in vec![(validate_obs, CHARGE_VALIDATE), (accept_obs, CHARGE_ACCEPT)].iter() {
66-
let regression = obs
67-
.group_by(|a, b| a.label == b.label)
68-
.map(|g| least_squares(g[0].label.to_owned(), g, 0))
69-
.collect::<Vec<_>>();
70-
71-
export(name, obs, &regression).unwrap();
72-
}
7364
}

0 commit comments

Comments
 (0)