From bbeb1b87c2b848189c0f71c93cf4b70b32d45a4d Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 5 Mar 2015 00:22:43 -0800 Subject: Update Rust code to the current Rust nightly Lots of changes! Hopefully everything is still semantically equivalent (tests still pass) --- rust/src/printer.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'rust/src/printer.rs') diff --git a/rust/src/printer.rs b/rust/src/printer.rs index f46b66c..591822b 100644 --- a/rust/src/printer.rs +++ b/rust/src/printer.rs @@ -3,7 +3,7 @@ use types::MalVal; pub fn escape_str(s: &str) -> String { let mut escaped = String::new(); escaped.push('"'); - for c in s.as_slice().chars() { + for c in s.chars() { let _ = match c { '"' => escaped.push_str("\\\""), '\\' => escaped.push_str("\\\\"), @@ -24,7 +24,7 @@ pub fn escape_str(s: &str) -> String { pub fn unescape_str(s: &str) -> String { let re1 = regex!(r#"\\""#); let re2 = regex!(r#"\n"#); - re2.replace_all(re1.replace_all(s.as_slice(), "\"").as_slice(), "\n") + re2.replace_all(&re1.replace_all(&s, "\""), "\n") } pub fn pr_list(lst: &Vec, pr: bool, @@ -38,7 +38,7 @@ pub fn pr_list(lst: &Vec, pr: bool, } else { res.push_str(join); } - res.push_str(mv.pr_str(pr).as_slice()); + res.push_str(&mv.pr_str(pr)); } res.push_str(end); res -- cgit v1.2.3