diff --git a/src/libstd/json.rs b/src/libstd/json.rs index 968c6d9e58b..c48b210dca2 100644 --- a/src/libstd/json.rs +++ b/src/libstd/json.rs @@ -827,7 +827,7 @@ fn read_owned_str(&self) -> ~str { debug!("read_owned_str"); match *self.pop() { String(ref s) => copy *s, - _ => fail!(~"not a string") + ref json => fail!(fmt!("not a string: %?", *json)) } } @@ -835,7 +835,7 @@ fn read_managed_str(&self) -> @str { debug!("read_managed_str"); match *self.pop() { String(ref s) => s.to_managed(), - _ => fail!(~"not a string") + ref json => fail!(fmt!("not a string: %?", *json)) } } @@ -872,7 +872,7 @@ fn read_enum_variant(&self, names: &[&str], f: &fn(uint) -> T) -> T { let name = match *self.peek() { String(ref s) => s, List([String(ref s), .. _]) => s, - json => fail!(fmt!("invalid variant: %?", json)), + ref json => fail!(fmt!("invalid variant: %?", *json)), }; let idx = match vec::position(names, |n| str::eq_slice(*n, *name)) { Some(idx) => idx,