diff --git a/xmpp/src/lib.rs b/xmpp/src/lib.rs index 6ed7ce833d23ba4f20eef769411cc0b8b26eaacc..dc205a5f02e8c8d22467a5fa6f8e7e918cdbba2d 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]