Uh oh!
There was an error while loading. Please reload this page.
json now defaults Option<_> to None. - #16971
Conversation
There was a problem hiding this comment.
This is not going to work right if I have a type named Option that is not std::option::Option.
Similarly, it presumably will not work right if I rename Option, using either use std::option::Option as Foo or type Foo = std::option::Option<int>.
There was a problem hiding this comment.
Good point, I totally missed that.
lilyball
commented
Sep 3, 2014
I feel like the right approach here really is to be able to provide a default value to use if the field isn't present. This is just another instance of the need to be able to customize deriving. |
alexcrichton
commented
Sep 4, 2014
Note that it is currently possible for decoders to emulate this behavior today, as it's what |
treeman
commented
Sep 4, 2014
I agree @kballard, we need default values. Thanks @alexcrichton, will take a peek. |
treeman
commented
Sep 9, 2014
Reworked the #17089 may enable us to specify default arguments, something like: I still think it's more ergonomic to have |
Resolve tests per file instead of per crate in test explorer Fix part of rust-lang#16827
Closes#12794.