-
Notifications
You must be signed in to change notification settings - Fork 346
Implement Default
for ParseOptions
and ParseOptions::new
?
#301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Default
for ParseOptions
and ParseOptions::new
Default
for ParseOptions
and ParseOptions::new
?
The reason this associated function is on A In my opinion this type does not represent a "thing" that anyone manipulates on its own. Its only reason for existence is that Rust does not have named parameters and default parameter values. (Both are required to make it a compatible change to add a new parameter to an existing API.) With these language features the API would be Removing the tags so that someone doesn’t jump on implementing this without considering whether it should be done at all. |
@SimonSapin if you think this is a poor idea I'm happy to defer to you and close. |
Yes, I think |
This seems like a type that might reasonably be constructed with default options, but I notice it doesn't even have a
new
ctor of any kind, when oftennew()
is a good indicator there should be adefault
.So we should probably add both.
It looks like this type is today always constructed from another base URL via
Url::options
, and it contains a lifetime. So a default method is going to need to return a&'static
-boundUrl
withNone
as the base Url.The text was updated successfully, but these errors were encountered: