From 11a56c3e9141045d92ad913495c2387b636f5d9b Mon Sep 17 00:00:00 2001 From: Erick Tryzelaar Date: Wed, 13 Jun 2012 08:30:54 -0700 Subject: [PATCH] Add a couple more to_json impls. --- src/libstd/json.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/libstd/json.rs b/src/libstd/json.rs index 1ac6a547659..a5a5ac31035 100644 --- a/src/libstd/json.rs +++ b/src/libstd/json.rs @@ -510,6 +510,14 @@ impl of to_json for json { fn to_json() -> json { self } } +impl of to_json for @json { + fn to_json() -> json { *self } +} + +impl of to_json for int { + fn to_json() -> json { num(self as float) } +} + impl of to_json for i8 { fn to_json() -> json { num(self as float) } } @@ -526,6 +534,10 @@ impl of to_json for i64 { fn to_json() -> json { num(self as float) } } +impl of to_json for uint { + fn to_json() -> json { num(self as float) } +} + impl of to_json for u8 { fn to_json() -> json { num(self as float) } } -- GitLab