diff --git a/crates/ruma-identifiers/src/matrix_uri.rs b/crates/ruma-identifiers/src/matrix_uri.rs index bf370d14..e28e96ce 100644 --- a/crates/ruma-identifiers/src/matrix_uri.rs +++ b/crates/ruma-identifiers/src/matrix_uri.rs @@ -226,6 +226,14 @@ impl fmt::Display for MatrixToUri { } } +impl TryFrom<&str> for MatrixToUri { + type Error = Error; + + fn try_from(s: &str) -> Result { + Self::parse(s) + } +} + #[cfg(test)] mod tests { use matches::assert_matches;