treexml-rs
treexml-rs copied to clipboard
Tests with mismatched types
Hello,
I've discovered your library. Thank you for putting it together. While looking through test cases, I've noticed that assert_eq! has mismatched types. For example
assert_eq!(root.find_child(|t| t.name == "child"), Some(&child));
comparing to "child" assuming that it is String whereas t.name is a String, but "child" is of &str type.
May I suggest altering assert_eq! to the following
assert_eq!(root.find_child(|t| t.name == "child".to_owned()), Some(&child));
Assuming that if that it is your intention to compare t.name to "child" as String type.