title: Omit values that are Option::None when encoding JSON with rustc_serialize
body: <p>I have a struct that I want to encode to JSON. This struct contains a field with type <code>Option&lt;i32&gt;</code>. Let's say</p>
  
  <pre><code>extern crate rustc_serialize;
  use rustc_serialize::json;
  
  #[derive(RustcEncodable)]
  struct TestStruct {
      test: Option&lt;i32&gt;
  }
  
  fn main() {
      let object = TestStruct {
          test: None
      };
  
      let obj = json::encode(&amp;object).unwrap();
  
      println!("{}", obj);
  }
  </code></pre>
  
  <p>This will give me the output</p>
  
  <pre><code>{"test": null}
  </code></pre>
  
  <p>Is there a convenient way to omit <code>Option</code> fields with value <code>None</code>? In this case I would like to have the output</p>
  
  <pre><code>{}
  </code></pre>