Skip to content

Commit c981001

Browse files
committed
nit: use format! instead of iterator
1 parent bed7ea8 commit c981001

File tree

2 files changed

+1
-12
lines changed

2 files changed

+1
-12
lines changed

src/librustc/hir/svh.rs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,7 @@ impl Svh {
3636
}
3737

3838
pub fn to_string(&self) -> String {
39-
let hash = self.hash;
40-
return (0..64).step_by(4).map(|i| hex(hash >> i)).collect();
41-
42-
fn hex(b: u64) -> char {
43-
let b = (b & 0xf) as u8;
44-
let b = match b {
45-
0 ... 9 => '0' as u8 + b,
46-
_ => 'a' as u8 + b - 10,
47-
};
48-
b as char
49-
}
39+
format!("{:016x}", self.hash)
5040
}
5141
}
5242

src/librustc/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
#![feature(rustc_private)]
3838
#![feature(slice_patterns)]
3939
#![feature(staged_api)]
40-
#![feature(step_by)]
4140
#![feature(question_mark)]
4241
#![cfg_attr(test, feature(test))]
4342

0 commit comments

Comments
 (0)