You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, if I add a default = "8000" to my port: Option<u16> without removing the Option, it gives the following error message.
the trait `std::str::FromStr` is not implemented for `std::option::Option<u16>`
I found this extremely confusing because I didn't try compiling it before adding the default and the documentation doesn't mention that adding default will narrow the set of valid type signatures, and the Option<i32> example from the docs was also breaking.
(I went in circles double-checking these examples for 15 minutes and looking at the FromStr API docs before it occurred to me that maybe default altered the set of valid types.)
The documentation for default should be amended to mention this.
The text was updated successfully, but these errors were encountered:
Currently, if I add a
default = "8000"
to myport: Option<u16>
without removing theOption
, it gives the following error message.I found this extremely confusing because I didn't try compiling it before adding the
default
and the documentation doesn't mention that addingdefault
will narrow the set of valid type signatures, and theOption<i32>
example from the docs was also breaking.(I went in circles double-checking these examples for 15 minutes and looking at the
FromStr
API docs before it occurred to me that maybedefault
altered the set of valid types.)The documentation for
default
should be amended to mention this.The text was updated successfully, but these errors were encountered: