std: Add a to_str impl for json::error.
This commit is contained in:
parent
ac4ac328ee
commit
a816176eb5
2 changed files with 10 additions and 3 deletions
|
@ -603,6 +603,12 @@ impl of to_str::to_str for json {
|
|||
fn to_str() -> str { to_str(self) }
|
||||
}
|
||||
|
||||
impl of to_str::to_str for error {
|
||||
fn to_str() -> str {
|
||||
#fmt("%u:%u: %s", self.line, self.col, self.msg)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
fn mk_dict(items: [(str, json)]) -> json {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue