treexml-rs icon indicating copy to clipboard operation
treexml-rs copied to clipboard

Tests with mismatched types

Open mlevkov opened this issue 5 years ago • 0 comments

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.

mlevkov avatar Jun 03 '20 04:06 mlevkov