macros: Allow non-String in generate_elem_id!().

This commit is contained in:
Emmanuel Gil Peyrot 2019-09-05 15:34:21 +02:00
commit c77221e437
3 changed files with 16 additions and 5 deletions

View file

@ -302,7 +302,11 @@ mod tests {
let elem: Element = "<text xmlns='http://jabber.org/protocol/mood'>Yay!</text>"
.parse()
.unwrap();
let elem2 = elem.clone();
let text = Text::try_from(elem).unwrap();
assert_eq!(text.0, String::from("Yay!"));
let elem3 = text.into();
assert_eq!(elem2, elem3);
}
}