diff options
author | Alex Crichton <alex@alexcrichton.com> | 2015-01-27 19:29:58 -0800 |
---|---|---|
committer | Alex Crichton <alex@alexcrichton.com> | 2015-01-27 19:29:58 -0800 |
commit | 482752b5f4c7bbb3e1b5fce28ec67720912ffb51 (patch) | |
tree | 6ccad51d7458b41d37619a8fdd42d2a176224a3f /src/show.rs | |
parent | 909a85069b866ab7384eda20a3ff7d751d8c2235 (diff) | |
download | milf-rs-482752b5f4c7bbb3e1b5fce28ec67720912ffb51.tar.gz milf-rs-482752b5f4c7bbb3e1b5fce28ec67720912ffb51.zip |
Migrate to as many stable functions as possible
Diffstat (limited to 'src/show.rs')
-rw-r--r-- | src/show.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/show.rs b/src/show.rs index fcbc277..21aec1e 100644 --- a/src/show.rs +++ b/src/show.rs @@ -13,7 +13,7 @@ impl fmt::Display for Value { match *self { String(ref s) => { try!(write!(f, "\"")); - for ch in s.as_slice().chars() { + for ch in s.chars() { match ch { '\u{8}' => try!(write!(f, "\\b")), '\u{9}' => try!(write!(f, "\\t")), @@ -57,7 +57,7 @@ impl<'a, 'b> Printer<'a, 'b> { match *v { Table(..) => continue, Array(ref a) => { - match a.as_slice().first() { + match a.first() { Some(&Table(..)) => continue, _ => {} } @@ -69,18 +69,18 @@ impl<'a, 'b> Printer<'a, 'b> { for (k, v) in table.iter() { match *v { Table(ref inner) => { - self.stack.push(k.as_slice()); + self.stack.push(&**k); try!(writeln!(self.output, "\n[{}]", self.stack.connect("."))); try!(self.print(inner)); self.stack.pop(); } Array(ref inner) => { - match inner.as_slice().first() { + match inner.first() { Some(&Table(..)) => {} _ => continue } - self.stack.push(k.as_slice()); + self.stack.push(&**k); for inner in inner.iter() { try!(writeln!(self.output, "\n[[{}]]", self.stack.connect("."))); |