diff --git a/clippy_lints/src/neg_cmp_op_on_partial_ord.rs b/clippy_lints/src/neg_cmp_op_on_partial_ord.rs index 24d18ed24e63..6b89ded82558 100644 --- a/clippy_lints/src/neg_cmp_op_on_partial_ord.rs +++ b/clippy_lints/src/neg_cmp_op_on_partial_ord.rs @@ -84,9 +84,9 @@ fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) { cx.span_lint( NEG_CMP_OP_ON_PARTIAL_ORD, expr.span, - "The use of negated comparision operators on partially orded\ - types produces code that is hard to read and refactor. Please\ - consider to use the partial_cmp() instead, to make it clear\ + "The use of negated comparision operators on partially orded \ + types produces code that is hard to read and refactor. Please \ + consider to use the `partial_cmp` instead, to make it clear \ that the two values could be incomparable." ) } diff --git a/tests/ui/neg_cmp_op_on_partial_ord.rs b/tests/ui/neg_cmp_op_on_partial_ord.rs index daf059040a03..f7fa09550e9e 100644 --- a/tests/ui/neg_cmp_op_on_partial_ord.rs +++ b/tests/ui/neg_cmp_op_on_partial_ord.rs @@ -32,7 +32,7 @@ fn main() { let _not_less = match a_value.partial_cmp(&another_value) { None | Some(Ordering::Greater) | Some(Ordering::Equal) => true, - _ => false, + _ => false, }; let _not_less_or_equal = match a_value.partial_cmp(&another_value) { None | Some(Ordering::Greater) => true, @@ -40,11 +40,11 @@ fn main() { }; let _not_greater = match a_value.partial_cmp(&another_value) { None | Some(Ordering::Less) | Some(Ordering::Equal) => true, - _ => false, + _ => false, }; let _not_greater_or_equal = match a_value.partial_cmp(&another_value) { None | Some(Ordering::Less) => true, - _ => false, + _ => false, }; diff --git a/tests/ui/neg_cmp_op_on_partial_ord.stderr b/tests/ui/neg_cmp_op_on_partial_ord.stderr index 0402cfd86e8a..5f0c240b4596 100644 --- a/tests/ui/neg_cmp_op_on_partial_ord.stderr +++ b/tests/ui/neg_cmp_op_on_partial_ord.stderr @@ -1,4 +1,4 @@ -error: The use of negated comparision operators on partially ordedtypes produces code that is hard to read and refactor. Pleaseconsider to use the partial_cmp() instead, to make it clearthat the two values could be incomparable. +error: The use of negated comparision operators on partially orded types produces code that is hard to read and refactor. Please consider to use the `partial_cmp` instead, to make it clear that the two values could be incomparable. --> $DIR/neg_cmp_op_on_partial_ord.rs:18:21 | 18 | let _not_less = !(a_value < another_value); @@ -6,19 +6,19 @@ error: The use of negated comparision operators on partially ordedtypes produces | = note: `-D neg-cmp-op-on-partial-ord` implied by `-D warnings` -error: The use of negated comparision operators on partially ordedtypes produces code that is hard to read and refactor. Pleaseconsider to use the partial_cmp() instead, to make it clearthat the two values could be incomparable. +error: The use of negated comparision operators on partially orded types produces code that is hard to read and refactor. Please consider to use the `partial_cmp` instead, to make it clear that the two values could be incomparable. --> $DIR/neg_cmp_op_on_partial_ord.rs:21:30 | 21 | let _not_less_or_equal = !(a_value <= another_value); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: The use of negated comparision operators on partially ordedtypes produces code that is hard to read and refactor. Pleaseconsider to use the partial_cmp() instead, to make it clearthat the two values could be incomparable. +error: The use of negated comparision operators on partially orded types produces code that is hard to read and refactor. Please consider to use the `partial_cmp` instead, to make it clear that the two values could be incomparable. --> $DIR/neg_cmp_op_on_partial_ord.rs:24:24 | 24 | let _not_greater = !(a_value > another_value); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: The use of negated comparision operators on partially ordedtypes produces code that is hard to read and refactor. Pleaseconsider to use the partial_cmp() instead, to make it clearthat the two values could be incomparable. +error: The use of negated comparision operators on partially orded types produces code that is hard to read and refactor. Please consider to use the `partial_cmp` instead, to make it clear that the two values could be incomparable. --> $DIR/neg_cmp_op_on_partial_ord.rs:27:33 | 27 | let _not_greater_or_equal = !(a_value >= another_value);