Skip to content
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

Implement FromStr for Url #18

Closed
wants to merge 1 commit into from
Closed

Implement FromStr for Url #18

wants to merge 1 commit into from

Conversation

@wycats
Copy link

wycats commented Aug 26, 2014

This was supported in the old url package. We used it to import env-var based configuration into a variety of types.

@SimonSapin
Copy link
Member

SimonSapin commented Aug 26, 2014

I’ve resisted doing this so far because I really don’t like FromStr. It feels like "too much magic" to me: when reading code that uses it, I sometimes have no idea what the expected type is because the compiler infers it.

I’m not familar with that configuration system, how much worse does it make it for you if you have to write Url::parse(string).ok() instead?

@TyOverby
Copy link

TyOverby commented May 4, 2015

Other libraries (like an argument parser library) could depend on an item having FromStr. I think it's a nice usability feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.