Skip to content

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

Merged
merged 1 commit into from
Jan 24, 2015

Conversation

tbu-
Copy link
Contributor

@tbu- tbu- commented Jan 23, 2015

r? @alexcrichton

Part of #20792 that wasn't done in your commit.


#[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>()); })
Copy link
Contributor

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?

@alexcrichton
Copy link
Member

r=me with @gankro's comment

@tbu-
Copy link
Contributor Author

tbu- commented Jan 23, 2015

@alexcrichton Now, Gankro's nits addressed and fixed the function names from test_format_i32 to test_format_int and similar.

@alexcrichton
Copy link
Member

@bors: r+ d909dad

Thanks!

@bors
Copy link
Collaborator

bors commented Jan 23, 2015

⌛ Testing commit d909dad with merge ba3f67c...

@bors
Copy link
Collaborator

bors commented Jan 24, 2015

💔 Test failed - auto-win-32-nopt-t

@alexcrichton
Copy link
Member

@bors: retry

@bors
Copy link
Collaborator

bors commented Jan 24, 2015

⌛ Testing commit d909dad with merge 796d009...

bors added a commit that referenced this pull request Jan 24, 2015
@bors bors merged commit d909dad into rust-lang:master Jan 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants