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

Fix test test_hash #351

Merged
merged 1 commit into from
May 9, 2024
Merged

Fix test test_hash #351

merged 1 commit into from
May 9, 2024

Conversation

lexoooooo
Copy link
Contributor

Compline fails on my machine (Clippy is on). And I found the test implement for Hash is incorrect.

x.hash() returns a () instead of an u32. So the test is meaningless. It will always succeed.

I write a pitch using a function hash() to compute a hash value :)

error: `assert_eq` of unit values detected. This will always succeed
   --> src/tests.rs:608:9
    |
608 |         assert_eq!(a.hash(&mut hasher), b.hash(&mut hasher));
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unit_cmp
    = note: `#[deny(clippy::unit_cmp)]` on by default

Copy link
Collaborator

@mbrubeck mbrubeck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@mbrubeck mbrubeck added this pull request to the merge queue May 9, 2024
Merged via the queue into servo:v2 with commit d0f49bc May 9, 2024
5 checks passed
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

Successfully merging this pull request may close these issues.

2 participants