bheisler / iai

Experimental one-shot benchmarking/profiling harness for Rust
Apache License 2.0
578 stars 23 forks source link

Fix warning and error in example code. #4

Closed weiby3 closed 3 years ago

weiby3 commented 3 years ago
warning: unused import: `main`
 --> benches/my_benchmark.rs:1:22
  |
1 | use iai::{black_box, main};
  |                      ^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

error[E0308]: mismatched types
  --> benches/my_benchmark.rs:15:28
   |
15 | fn iai_benchmark_long() -> u64 {
   |    ------------------      ^^^ expected `u64`, found `()`
   |    |
   |    implicitly returns `()` as its body has no tail or `return` expression
16 |     fibonacci(black_box(30));
   |                             - help: consider removing this semicolon

error: aborting due to previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0308`.
bheisler commented 3 years ago

Thanks!