diff --git a/xmpp/src/lib.rs b/xmpp/src/lib.rs index 6ed7ce83..dc205a5f 100644 --- a/xmpp/src/lib.rs +++ b/xmpp/src/lib.rs @@ -77,6 +77,14 @@ impl fmt::Display for RoomNick { } } +impl core::str::FromStr for RoomNick { + type Err = crate::jid::Error; + + fn from_str(s: &str) -> Result { + Ok(Self::new(ResourcePart::new(s)?.into())) + } +} + #[cfg(test)] mod tests { #[test]