summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorErick Tryzelaar <erick.tryzelaar@gmail.com>2012-06-11 08:32:38 -0700
committerGraydon Hoare <graydon@mozilla.com>2012-06-12 18:10:18 -0700
commita816176eb56bd87552b73069bcb6c2dd69ce7d69 (patch)
tree49961946e45c89b54e39817ece7d66cd7ffc8c43 /src/libstd
parentac4ac328ee1b2c90194a17eab9b30b23112e4d95 (diff)
downloadrust-a816176eb56bd87552b73069bcb6c2dd69ce7d69.tar.gz
rust-a816176eb56bd87552b73069bcb6c2dd69ce7d69.zip
std: Add a to_str impl for json::error.
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/json.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libstd/json.rs b/src/libstd/json.rs
index 5d9427c72b8..1ccdc5042dd 100644
--- a/src/libstd/json.rs
+++ b/src/libstd/json.rs
@@ -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 {