-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Clean up isize
, usize
. Don't bench allocation but formatting.
#21537
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
||
#[bench] | ||
fn format_bin(b: &mut Bencher) { | ||
let mut rng = weak_rng(); | ||
b.iter(|| { format!("{:b}", rng.gen::<uint>()); }) | ||
b.iter(|| { let _ = write!(&mut NullWriter, "{:b}", rng.gen::<u32>()); }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason to feed this into a let
and not just return it from the closure?
r=me with @gankro's comment |
@alexcrichton Now, Gankro's nits addressed and fixed the function names from |
@bors: r+ d909dad Thanks! |
⌛ Testing commit d909dad with merge ba3f67c... |
💔 Test failed - auto-win-32-nopt-t |
@bors: retry |
⌛ Testing commit d909dad with merge 796d009... |
r? @alexcrichton Part of #20792 that wasn't done in your commit.
r? @alexcrichton
Part of #20792 that wasn't done in your commit.