metamath / metamath-knife

Metamath-knife can rapidly verify Metamath proofs, providing strong confidence that the proofs are correct.
Apache License 2.0
25 stars 10 forks source link

Clippy #19

Closed tirix closed 2 years ago

tirix commented 2 years ago

This is the result of a clippy pass over the whole project. I've generally accepted clippy's suggestions, except in the following cases where I've added allow's to silence it:

I've also changed the Travis CI to include clippy. @david-a-wheeler could you please check especially if I've done that correctly?

tirix commented 2 years ago

@david-a-wheeler my initial changes to the Travis CI were probably buggy, so Travis was not run. I changed to a simpler version, which runs clippy on the whole matrix: I don't think this is necessary, I suppose we could have a single clippy step?

digama0 commented 2 years ago

util.rs:45 allow(clippy::ptr_eq) I'm unsure about this one, but I assume this is different from the default ptr_eq, so we want to keep it.

It's not. The default ptr_eq exists on pointers, but they will be coerced if you use it on references:

fn ptr_eq<T>(x: &T, y: &T) -> bool {
    std::ptr::eq(x, y)
}

This differs from x == y, which will call the PartialEq implementation for T.

tirix commented 2 years ago

Many thanks Mario! I've applied all your propositions.