Skip to content

Implement TryFrom<&str> #624

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

Closed
ranfdev opened this issue Aug 12, 2020 · 1 comment
Closed

Implement TryFrom<&str> #624

ranfdev opened this issue Aug 12, 2020 · 1 comment

Comments

@ranfdev
Copy link

ranfdev commented Aug 12, 2020

Currently the Url type has an automatic TryFrom implementation returning core::convert::Infallible.

It would be nice to have a TryFrom<&str> returning url::ParseError, so that programs can do

fn get<U: TryInto<Url>>(dest: U) -> Result<()> {
}

(TryInto<Url> should be auto-implemented once there is TryFrom<&str>)

@ranfdev ranfdev changed the title Implement try_from for &str Implement TryFrom<&str> Aug 12, 2020
@ranfdev
Copy link
Author

ranfdev commented Aug 12, 2020

Uff, sorry, I didn't search the github issues enough.
This was already solved in #569.

If you can't find the trait on docs.rs, it's because the version with the required changes hasn't been released yet.

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

No branches or pull requests

1 participant