Skip to content

Commit

Permalink
Added workaround for rust-lang/rust#49336.
Browse files Browse the repository at this point in the history
Fixes #133.
  • Loading branch information
bheisler committed Mar 25, 2018
1 parent 17d16ca commit d3a21ec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 1 addition & 5 deletions src/html/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -536,11 +536,7 @@ impl Html {
}
}

let path_prefix = if full_summary {
"../.."
} else {
"../../../.."
};
let path_prefix = if full_summary { "../.." } else { "../../../.." };
let benchmarks = data.iter()
.map(|&&(ref id, _)| IndividualBenchmark::new(path_prefix, id))
.collect();
Expand Down
4 changes: 4 additions & 0 deletions src/routine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,15 @@ where

let mut total_iters = 0;
let start = Instant::now();
// This vec is used as a workaround for a rust bug - #49336
// It should be removed a reasonable time period after that bug is fixed.
let mut workaround = Vec::with_capacity(25);
loop {
(*f)(&mut b, parameter);

total_iters += b.iters;
let elapsed = start.elapsed();
workaround.push(total_iters);
if elapsed > how_long {
return (elapsed.to_nanos(), total_iters);
}
Expand Down

0 comments on commit d3a21ec

Please sign in to comment.