diff --git a/src/libserialize/json.rs b/src/libserialize/json.rs index 436e969c48c..f2717f6f263 100644 --- a/src/libserialize/json.rs +++ b/src/libserialize/json.rs @@ -350,11 +350,7 @@ fn escape_str(s: &str) -> String { } fn spaces(n: uint) -> String { - let mut ss = String::new(); - for _ in range(0, n) { - ss.push_str(" "); - } - return ss + String::from_char(n, ' ') } /// A structure for implementing serialization to JSON.