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.
This commit is contained in:
Huon Wilson 2012-12-10 03:29:33 +01:00 committed by Graydon Hoare
parent a55ea48d2b
commit 76dc7818ea
1 changed files with 5 additions and 2 deletions

View File

@ -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 {