1
Fork 0

replace explicit calls to vec::each with vec::each_ref, partially demode str

This commit is contained in:
Niko Matsakis 2012-09-18 18:31:59 -07:00
parent e17a3b3194
commit 1be24f0758
77 changed files with 565 additions and 601 deletions

View file

@ -179,7 +179,7 @@ fn to_writer_pretty(wr: io::Writer, j: Json, indent: uint) {
fn escape_str(s: &str) -> ~str {
let mut escaped = ~"\"";
do str::chars_iter(s) |c| {
for str::chars_each(s) |c| {
match c {
'"' => escaped += ~"\\\"",
'\\' => escaped += ~"\\\\",
@ -834,8 +834,8 @@ mod tests {
fn mk_dict(items: &[(~str, Json)]) -> Json {
let d = map::str_hash();
do vec::iter(items) |item| {
let (key, value) = copy item;
for vec::each_ref(items) |item| {
let (key, value) = copy *item;
d.insert(key, value);
};