Skip to content

Commit 6199a2b

Browse files
committed
Switch from test::black_box to std::hint::black_box
1 parent 221e3d4 commit 6199a2b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

benches/bench.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99

1010
extern crate test;
1111

12+
use std::hint;
1213
use std::io::Write;
1314
use std::{f32, f64};
14-
use test::{black_box, Bencher};
15+
use test::Bencher;
1516

1617
macro_rules! benches {
1718
($($name:ident($value:expr),)*) => {
@@ -23,9 +24,9 @@ macro_rules! benches {
2324
let mut buf = ryu::Buffer::new();
2425

2526
b.iter(move || {
26-
let value = black_box($value);
27+
let value = hint::black_box($value);
2728
let formatted = buf.format_finite(value);
28-
black_box(formatted);
29+
hint::black_box(formatted);
2930
});
3031
}
3132
)*
@@ -40,9 +41,9 @@ macro_rules! benches {
4041

4142
b.iter(|| {
4243
buf.clear();
43-
let value = black_box($value);
44+
let value = hint::black_box($value);
4445
write!(&mut buf, "{}", value).unwrap();
45-
black_box(buf.as_slice());
46+
hint::black_box(buf.as_slice());
4647
});
4748
}
4849
)*

0 commit comments

Comments
 (0)