nit: use format! instead of iterator

This commit is contained in:
Niko Matsakis 2016-05-12 10:12:58 -04:00
parent bed7ea8609
commit c981001389
2 changed files with 1 additions and 12 deletions

View File

@ -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)
}
}

View File

@ -37,7 +37,6 @@
#![feature(rustc_private)]
#![feature(slice_patterns)]
#![feature(staged_api)]
#![feature(step_by)]
#![feature(question_mark)]
#![cfg_attr(test, feature(test))]