summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorHuon Wilson <dbau.pp+github@gmail.com>2012-12-10 03:29:33 +0100
committerGraydon Hoare <graydon@mozilla.com>2012-12-11 16:04:58 -0800
commit76dc7818eae05dab94429a61c95a400a2b85c2fe (patch)
tree052bfef17f8dd22e8042dcae2b0e83e2a83907fb /src/libstd
parenta55ea48d2bd3b56ce6e8667e8bebc72371f17dd8 (diff)
downloadrust-76dc7818eae05dab94429a61c95a400a2b85c2fe.tar.gz
rust-76dc7818eae05dab94429a61c95a400a2b85c2fe.zip
libstd: Implement read_managed_str for the JSON deserialiser.
The FIXME is an underlying issue (a core::at_str library) that this
doesn't address.
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/json.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libstd/json.rs b/src/libstd/json.rs
index eb96e074a82..70bffb21587 100644
--- a/src/libstd/json.rs
+++ b/src/libstd/json.rs
@@ -782,8 +782,11 @@ pub impl Deserializer: serialization::Deserializer {
     }
 
     fn read_managed_str(&self) -> @str {
-        // FIXME(#3604): There's no way to convert from a ~str to a @str.
-        fail ~"read_managed_str()";
+        debug!("read_managed_str");
+        match *self.pop() {
+            String(ref s) => s.to_managed(),
+            _ => fail ~"not a string"
+        }
     }
 
     fn read_owned<T>(&self, f: fn() -> T) -> T {