Skip to content

Commit 76dc781

Browse files
huonwgraydon
authored andcommitted
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.
1 parent a55ea48 commit 76dc781

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/libstd/json.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -782,8 +782,11 @@ pub impl Deserializer: serialization::Deserializer {
782782
}
783783

784784
fn read_managed_str(&self) -> @str {
785-
// FIXME(#3604): There's no way to convert from a ~str to a @str.
786-
fail ~"read_managed_str()";
785+
debug!("read_managed_str");
786+
match *self.pop() {
787+
String(ref s) => s.to_managed(),
788+
_ => fail ~"not a string"
789+
}
787790
}
788791

789792
fn read_owned<T>(&self, f: fn() -> T) -> T {

0 commit comments

Comments
 (0)