mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-08 01:28:18 +03:00
Fixed spelling and indentation issues in neg_cmp_op_on_partial_ord related files.
This commit is contained in:
@@ -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."
|
||||
)
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user