We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 44c760d commit 6071372Copy full SHA for 6071372
src/cargo/util/profile.rs
@@ -2,6 +2,7 @@ use std::os;
2
use std::mem;
3
use std::fmt::Show;
4
use time;
5
+use std::iter::repeat;
6
use std::cell::RefCell;
7
8
thread_local!(static PROFILE_STACK: RefCell<Vec<u64>> = RefCell::new(Vec::new()));
@@ -38,13 +39,8 @@ impl Drop for Profiler {
38
39
let mut last = 0;
40
for (i, &(l, time, ref msg)) in msgs.iter().enumerate() {
41
if l != lvl { continue }
-
42
- let mut spaces = String::new();
43
- for _ in range(0u, lvl + 1) {
44
- spaces.push_str(" ");
45
- }
46
47
- println!("{} {:6}ms - {}", spaces, time / 1000000, msg);
+ println!("{} {:6}ms - {}", repeat(" ").take(lvl + 1).collect::<String>(),
+ time / 1000000, msg);
48
49
print(lvl + 1, msgs.slice(last, i));
50
last = i;
0 commit comments