Skip to content

Tests with mismatched types #17

Description

@mlevkov

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions