Skip to content

Commit 11a56c3

Browse files
committed
Add a couple more to_json impls.
1 parent ab9c900 commit 11a56c3

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/libstd/json.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,14 @@ impl of to_json for json {
510510
fn to_json() -> json { self }
511511
}
512512

513+
impl of to_json for @json {
514+
fn to_json() -> json { *self }
515+
}
516+
517+
impl of to_json for int {
518+
fn to_json() -> json { num(self as float) }
519+
}
520+
513521
impl of to_json for i8 {
514522
fn to_json() -> json { num(self as float) }
515523
}
@@ -526,6 +534,10 @@ impl of to_json for i64 {
526534
fn to_json() -> json { num(self as float) }
527535
}
528536

537+
impl of to_json for uint {
538+
fn to_json() -> json { num(self as float) }
539+
}
540+
529541
impl of to_json for u8 {
530542
fn to_json() -> json { num(self as float) }
531543
}

0 commit comments

Comments
 (0)