Skip to content

Commit

Permalink
feat: TryInto trait bound for uri::Builder
Browse files Browse the repository at this point in the history
  • Loading branch information
rob committed Nov 28, 2024
1 parent adef803 commit dded3e8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/uri/builder.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::convert::{TryFrom, TryInto};
use std::convert::TryInto;

use super::{Authority, Parts, PathAndQuery, Scheme};
use crate::Uri;
Expand Down Expand Up @@ -44,8 +44,8 @@ impl Builder {
/// ```
pub fn scheme<T>(self, scheme: T) -> Self
where
Scheme: TryFrom<T>,
<Scheme as TryFrom<T>>::Error: Into<crate::Error>,
T: TryInto<Scheme>,
<T as TryInto<Scheme>>::Error: Into<crate::Error>,
{
self.map(move |mut parts| {
let scheme = scheme.try_into().map_err(Into::into)?;
Expand All @@ -68,8 +68,8 @@ impl Builder {
/// ```
pub fn authority<T>(self, auth: T) -> Self
where
Authority: TryFrom<T>,
<Authority as TryFrom<T>>::Error: Into<crate::Error>,
T: TryInto<Authority>,
<T as TryInto<Authority>>::Error: Into<crate::Error>,
{
self.map(move |mut parts| {
let auth = auth.try_into().map_err(Into::into)?;
Expand All @@ -92,8 +92,8 @@ impl Builder {
/// ```
pub fn path_and_query<T>(self, p_and_q: T) -> Self
where
PathAndQuery: TryFrom<T>,
<PathAndQuery as TryFrom<T>>::Error: Into<crate::Error>,
T: TryInto<PathAndQuery>,
<T as TryInto<PathAndQuery>>::Error: Into<crate::Error>,
{
self.map(move |mut parts| {
let p_and_q = p_and_q.try_into().map_err(Into::into)?;
Expand Down

0 comments on commit dded3e8

Please sign in to comment.