Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests with mismatched types #17

Open
mlevkov opened this issue Jun 3, 2020 · 0 comments
Open

Tests with mismatched types #17

mlevkov opened this issue Jun 3, 2020 · 0 comments

Comments

@mlevkov
Copy link

mlevkov commented Jun 3, 2020

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 mlevkov mentioned this issue Jun 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant