Skip to content

Conversation

@M3rs
Copy link
Contributor

@M3rs M3rs commented May 9, 2019

Add TryFrom impl for Destination, for compiler version >= 1.34.
Add basic unit tests for TryFrom impl

Ref Issue: Implement TryFrom for Destination #1808

M3rs added 2 commits May 8, 2019 18:57
Add TryFrom<Uri> impl for Destination, for compiler version >= 1.34.
Add basic unit tests for TryFrom impl

Ref Issue: Implement TryFrom for Destination hyperium#1808
Add #[cfg(try_from)] to TryFrom import.

Ref Issue; hyperium#1808
fn try_from(uri: Uri) -> Result<Self, Self::Error> {
uri.authority_part().ok_or(::error::Parse::Uri)?;
uri.scheme_part().ok_or(::error::Parse::Uri)?;
Ok(Destination { uri })
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this can just call Destination::try_from_uri internally.

Change TryFrom<Uri> for Destination to use Destination's
internal try_from_uri method.

Ref Issue: hyperium#1808
Copy link
Member

@seanmonstar seanmonstar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\o/

@seanmonstar seanmonstar merged commit d1183a8 into hyperium:master May 9, 2019
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

Successfully merging this pull request may close these issues.

2 participants