diff --git a/xmpp-parsers/src/bookmarks.rs b/xmpp-parsers/src/bookmarks.rs index 7346cd8..6276d2b 100644 --- a/xmpp-parsers/src/bookmarks.rs +++ b/xmpp-parsers/src/bookmarks.rs @@ -24,7 +24,7 @@ generate_element!( jid: Required = "jid", /// A user-defined name for this conference. - name: Required = "name", + name: Option = "name", ], children: [ /// The nick the user will use to join this conference. @@ -40,7 +40,7 @@ generate_element!( Url, "url", BOOKMARKS, attributes: [ /// A user-defined name for this URL. - name: Required = "name", + name: Option = "name", /// The URL of this bookmark. url: Required = "url", @@ -106,7 +106,7 @@ mod tests { let elem: Element = "Coucousecret".parse().unwrap(); let storage = Storage::try_from(elem).unwrap(); assert_eq!(storage.urls.len(), 1); - assert_eq!(storage.urls[0].name, "Example"); + assert_eq!(storage.urls[0].clone().name.unwrap(), "Example"); assert_eq!(storage.urls[0].url, "https://example.org/"); assert_eq!(storage.conferences.len(), 1); assert_eq!(storage.conferences[0].autojoin, Autojoin::True); @@ -114,7 +114,7 @@ mod tests { storage.conferences[0].jid, BareJid::new("test-muc", "muc.localhost") ); - assert_eq!(storage.conferences[0].name, "Test MUC"); + assert_eq!(storage.conferences[0].clone().name.unwrap(), "Test MUC"); assert_eq!(storage.conferences[0].clone().nick.unwrap(), "Coucou"); assert_eq!(storage.conferences[0].clone().password.unwrap(), "secret"); }