Skip to content

Commit 0c76a10

Browse files
committed
fix pack (graphite bad)
1 parent 69c2e0d commit 0c76a10

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

benches/bench.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ pub fn bench_pack(c: &mut Criterion) {
4242
bench_arbitrary_with(
4343
c,
4444
format!("pack_to/{size}"),
45-
arbitrary_bytes(size)
46-
.prop_map(|nibbles| (vec![0; nibbles.len().div_ceil(2)], Nibbles::unpack(nibbles))),
45+
arbitrary_bytes(size).prop_map(|bytes| (vec![0; bytes.len()], Nibbles::unpack(bytes))),
4746
|(buffer, nibbles)| {
4847
black_box(nibbles).pack_to(black_box(&mut buffer.clone()));
4948
},

benches/prelude.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ fn mk_setup<'a, T: Strategy>(
5656
/// Codspeed does not batch inputs even if `iter_batched` is used, so we have to
5757
/// do it ourselves for operations that would otherwise be too fast to be
5858
/// measured accurately.
59-
// #[cfg(codspeed)]
59+
#[cfg(codspeed)]
6060
#[inline]
6161
fn manual_batch<T, U>(mut setup: impl FnMut() -> T, mut f: impl FnMut(&T) -> U) -> impl FnMut(T) {
6262
let inputs =
@@ -71,7 +71,9 @@ fn manual_batch<T, U>(mut setup: impl FnMut() -> T, mut f: impl FnMut(&T) -> U)
7171
}
7272
}
7373

74-
// #[cfg(not(codspeed))]
75-
// fn manual_batch<T, U>(_setup: impl FnMut() -> T, f: impl FnMut(T) -> U) -> impl FnMut(T) -> U {
76-
// f
77-
// }
74+
#[cfg(not(codspeed))]
75+
fn manual_batch<T, U>(_setup: impl FnMut() -> T, mut f: impl FnMut(&T) -> U) -> impl FnMut(T) {
76+
move |input| {
77+
f(&input);
78+
}
79+
}

deny.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ignore = []
55

66
[bans]
77
multiple-versions = "warn"
8-
wildcards = "deny"
8+
wildcards = "warn"
99
highlight = "all"
1010

1111
[licenses]

0 commit comments

Comments
 (0)