Skip to content

Commit 8a5c5b6

Browse files
committed
auto merge of #14932 : Sawyer47/rust/json-smallfix, r=huonw
2 parents 5abf794 + b71fa9b commit 8a5c5b6

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/libserialize/json.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -350,11 +350,7 @@ fn escape_str(s: &str) -> String {
350350
}
351351

352352
fn spaces(n: uint) -> String {
353-
let mut ss = String::new();
354-
for _ in range(0, n) {
355-
ss.push_str(" ");
356-
}
357-
return ss
353+
String::from_char(n, ' ')
358354
}
359355

360356
/// A structure for implementing serialization to JSON.

0 commit comments

Comments
 (0)