Skip to content

Commit

Permalink
Fixed spelling and indentation issues in neg_cmp_op_on_partial_ord re…
Browse files Browse the repository at this point in the history
…lated files.
  • Loading branch information
0ndorio committed Jun 3, 2018
1 parent 86304d8 commit 09ea75b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions clippy_lints/src/neg_cmp_op_on_partial_ord.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NoNegCompOpForPartialOrd {
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."
)
}
Expand Down
6 changes: 3 additions & 3 deletions tests/ui/neg_cmp_op_on_partial_ord.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@ 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,
_ => false,
};
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,
};


Expand Down
8 changes: 4 additions & 4 deletions tests/ui/neg_cmp_op_on_partial_ord.stderr
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
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);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= 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);
Expand Down

0 comments on commit 09ea75b

Please sign in to comment.