Skip to content

Commit

Permalink
nit: use format! instead of iterator
Browse files Browse the repository at this point in the history
  • Loading branch information
nikomatsakis committed May 18, 2016
1 parent bed7ea8 commit c981001
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
12 changes: 1 addition & 11 deletions src/librustc/hir/svh.rs
Expand Up @@ -36,17 +36,7 @@ impl Svh {
}

pub fn to_string(&self) -> String {
let hash = self.hash;
return (0..64).step_by(4).map(|i| hex(hash >> i)).collect();

fn hex(b: u64) -> char {
let b = (b & 0xf) as u8;
let b = match b {
0 ... 9 => '0' as u8 + b,
_ => 'a' as u8 + b - 10,
};
b as char
}
format!("{:016x}", self.hash)
}
}

Expand Down
1 change: 0 additions & 1 deletion src/librustc/lib.rs
Expand Up @@ -37,7 +37,6 @@
#![feature(rustc_private)]
#![feature(slice_patterns)]
#![feature(staged_api)]
#![feature(step_by)]
#![feature(question_mark)]
#![cfg_attr(test, feature(test))]

Expand Down

0 comments on commit c981001

Please sign in to comment.