mozilla/rust — pull request #12936 by seanmonstar (2014-03-16 16:14:11+00:00)
Title: serialize: impl ToJson for all Encodables

I just wanted to submit this at this point to see if something like this would be accepted. If so, I can clean it up some more, such as converting to `Vec`, etc.

The short is that this is now possible:

```rust
#[deriving(Encodable)]
struct Foo {
bar: uint
}

foo.to_json(); // => json::Object(TreeMap)
```

fixes #8335