fix str to mxc conversion; add convenience OwnedMxcUri conversion
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
01e910dccf
commit
25fbd64b96
@ -84,6 +84,16 @@ impl<'a> TryFrom<&'a str> for Mxc<'a> {
|
||||
type Error = MxcUriError;
|
||||
|
||||
fn try_from(s: &'a str) -> Result<Self, Self::Error> {
|
||||
let s: &MxcUri = s.into();
|
||||
s.try_into()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> TryFrom<&'a OwnedMxcUri> for Mxc<'a> {
|
||||
type Error = MxcUriError;
|
||||
|
||||
fn try_from(s: &'a OwnedMxcUri) -> Result<Self, Self::Error> {
|
||||
let s: &MxcUri = s.as_ref();
|
||||
s.try_into()
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user