Is your feature request related to a problem? Please describe.
Not a major blocker, but it would be great to include clippy
to avoid bugs and standardize code style.
For example, the code below is blocked by clippy::derive_ord_xor_partial_ord
lint (details)
Based on std::cmp::Ord
's documentation,
Trait for types that form a total order.
Implementations must be consistent with the PartialOrd implementation, and ensure max, min, and clamp are consistent with cmp:
partial_cmp(a, b) == Some(cmp(a, b)).
...
It’s easy to accidentally make cmp and partial_cmp disagree by deriving some of the traits and manually implementing others.
And the current Ord
impl for Value
in gitql-ast
violates the above requirements with the test case below,
let v1 = Value::Integer(1);
let v2 = Value::Boolean(true);
assert_eq!(Some(v1.cmp(&v2)), v1.partial_cmp(&v2)); // failed, `Some(Equal)` vs `Some(Less)`
Another thing: in gitql-ast
crate alone, clippy
outputs below (most of them are needless_return
), which is quite concerning,
warning: `gitql-ast` (lib) generated 74 warnings
error: could not compile `gitql-ast` (lib) due to previous error; 74 warnings emitted
Describe the solution you'd like
Describe alternatives you've considered
None
Additional context
None