aboutsummaryrefslogtreecommitdiff
path: root/rust/src/printer.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-03-05 00:22:43 -0800
committerAlex Crichton <alex@alexcrichton.com>2015-03-05 00:40:57 -0800
commitbbeb1b87c2b848189c0f71c93cf4b70b32d45a4d (patch)
tree257ac1a8a70f7f981be440c22763dd9ec7e1e562 /rust/src/printer.rs
parenta551bd4cd4d802173057ed124b911abed4ec530b (diff)
downloadmal-bbeb1b87c2b848189c0f71c93cf4b70b32d45a4d.tar.gz
mal-bbeb1b87c2b848189c0f71c93cf4b70b32d45a4d.zip
Update Rust code to the current Rust nightly
Lots of changes! Hopefully everything is still semantically equivalent (tests still pass)
Diffstat (limited to 'rust/src/printer.rs')
-rw-r--r--rust/src/printer.rs6
1 files changed, 3 insertions, 3 deletions
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<MalVal>, pr: bool,
@@ -38,7 +38,7 @@ pub fn pr_list(lst: &Vec<MalVal>, 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