Compare commits
2 commits
main
...
parse-impl
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2aa64ad1de | ||
|
|
b80408d806 |
2 changed files with 4 additions and 12 deletions
|
|
@ -20,12 +20,8 @@ where
|
|||
for<'de2> <Kind as Collection>::Kind: Deserialize<'de2>,
|
||||
{
|
||||
/// Construct a new CollectionId instance
|
||||
pub fn parse<T>(url: T) -> Result<Self, url::ParseError>
|
||||
where
|
||||
T: TryInto<Url>,
|
||||
url::ParseError: From<<T as TryInto<Url>>::Error>,
|
||||
{
|
||||
Ok(Self(Box::new(url.try_into()?), PhantomData::<Kind>))
|
||||
pub fn parse(url: &str) -> Result<Self, url::ParseError> {
|
||||
Ok(Self(Box::new(Url::parse(url)?), PhantomData::<Kind>))
|
||||
}
|
||||
|
||||
/// Fetches collection over HTTP
|
||||
|
|
|
|||
|
|
@ -65,12 +65,8 @@ where
|
|||
for<'de2> <Kind as Object>::Kind: serde::Deserialize<'de2>,
|
||||
{
|
||||
/// Construct a new objectid instance
|
||||
pub fn parse<T>(url: T) -> Result<Self, url::ParseError>
|
||||
where
|
||||
T: TryInto<Url>,
|
||||
url::ParseError: From<<T as TryInto<Url>>::Error>,
|
||||
{
|
||||
Ok(ObjectId(Box::new(url.try_into()?), PhantomData::<Kind>))
|
||||
pub fn parse(url: &str) -> Result<Self, url::ParseError> {
|
||||
Ok(Self(Box::new(Url::parse(url)?), PhantomData::<Kind>))
|
||||
}
|
||||
|
||||
/// Returns a reference to the wrapped URL value
|
||||
|
|
|
|||
Loading…
Reference in a new issue