diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2012-12-10 03:29:33 +0100 |
|---|---|---|
| committer | Graydon Hoare <graydon@mozilla.com> | 2012-12-11 16:04:58 -0800 |
| commit | 76dc7818eae05dab94429a61c95a400a2b85c2fe (patch) | |
| tree | 052bfef17f8dd22e8042dcae2b0e83e2a83907fb /src/libstd | |
| parent | a55ea48d2bd3b56ce6e8667e8bebc72371f17dd8 (diff) | |
| download | rust-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.rs | 7 |
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 { |
