Small improvement for json PrettyEncoder
This commit is contained in:
parent
6d8342f5e9
commit
b71fa9bd72
1 changed files with 1 additions and 5 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue