Skip to content

Commit

Permalink
Small improvement for json PrettyEncoder
Browse files Browse the repository at this point in the history
  • Loading branch information
Sawyer47 committed Jun 15, 2014
1 parent 6d8342f commit b71fa9b
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/libserialize/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

1 comment on commit b71fa9b

@huonw
Copy link

@huonw huonw commented on b71fa9b Jun 16, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r+

Please sign in to comment.