diff --git a/src/fetch/collection_id.rs b/src/fetch/collection_id.rs index 068ab0b..ae17ca0 100644 --- a/src/fetch/collection_id.rs +++ b/src/fetch/collection_id.rs @@ -20,12 +20,8 @@ where for<'de2> ::Kind: Deserialize<'de2>, { /// Construct a new CollectionId instance - pub fn parse(url: T) -> Result - where - T: TryInto, - url::ParseError: From<>::Error>, - { - Ok(Self(Box::new(url.try_into()?), PhantomData::)) + pub fn parse(url: &str) -> Result { + Ok(Self(Box::new(Url::parse(url)?), PhantomData::)) } /// Fetches collection over HTTP diff --git a/src/fetch/object_id.rs b/src/fetch/object_id.rs index 921951c..179a82c 100644 --- a/src/fetch/object_id.rs +++ b/src/fetch/object_id.rs @@ -65,12 +65,8 @@ where for<'de2> ::Kind: serde::Deserialize<'de2>, { /// Construct a new objectid instance - pub fn parse(url: T) -> Result - where - T: TryInto, - url::ParseError: From<>::Error>, - { - Ok(ObjectId(Box::new(url.try_into()?), PhantomData::)) + pub fn parse(url: &str) -> Result { + Ok(Self(Box::new(Url::parse(url)?), PhantomData::)) } /// Returns a reference to the wrapped URL value