Skip to content

Commit

Permalink
chore/easy: ord clippy lint (#14356)
Browse files Browse the repository at this point in the history
## Description 

This is the last cleanup for the outstanding lints from
MystenLabs/sui#14167
In order to preserve existing behavior, it was easier to selectively
ignore the lints on specific files.

## Test Plan 

Existing
---
If your changes are not user-facing and not a breaking change, you can
skip the following section. Otherwise, please indicate what changed, and
then add to the Release Notes section as highlighted during the release
process.

### Type of Change (Check all that apply)

- [ ] protocol change
- [ ] user-visible impact
- [ ] breaking change for a client SDKs
- [ ] breaking change for FNs (FN binary must upgrade)
- [ ] breaking change for validators or node operators (must upgrade
binaries)
- [ ] breaking change for on-chain data layout
- [ ] necessitate either a data wipe or data migration

### Release notes
  • Loading branch information
oxade authored Oct 20, 2023
1 parent 0a7d348 commit b18005b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions move-analyzer/src/symbols.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
//! definitions, the symbolicator builds a scope stack, entering encountered definitions and
//! matching uses to a definition in the innermost scope.
#![allow(clippy::incorrect_partial_ord_impl_on_ord_type)]

use crate::{
context::Context,
diagnostics::{lsp_diagnostics, lsp_empty_diagnostics},
Expand Down Expand Up @@ -167,6 +169,7 @@ struct StructDef {
field_defs: Vec<FieldDef>,
}

#[allow(clippy::incorrect_partial_ord_impl_on_ord_type)]
#[derive(Derivative, Debug, Clone, PartialEq, Eq)]
#[derivative(PartialOrd, Ord)]
pub struct FunctionDef {
Expand Down
1 change: 1 addition & 0 deletions move-borrow-graph/src/references.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ impl<Loc: Copy, Lbl: Clone + Ord> PartialEq for BorrowEdge<Loc, Lbl> {

impl<Loc: Copy, Lbl: Clone + Ord> Eq for BorrowEdge<Loc, Lbl> {}

#[allow(clippy::incorrect_partial_ord_impl_on_ord_type)]
impl<Loc: Copy, Lbl: Clone + Ord> PartialOrd for BorrowEdge<Loc, Lbl> {
fn partial_cmp(&self, other: &BorrowEdge<Loc, Lbl>) -> Option<Ordering> {
BorrowEdgeNoLoc::new(self).partial_cmp(&BorrowEdgeNoLoc::new(other))
Expand Down
1 change: 1 addition & 0 deletions move-compiler/src/shared/unique_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ impl<T: TName> PartialEq for UniqueSet<T> {
}
impl<T: TName> Eq for UniqueSet<T> {}

#[allow(clippy::incorrect_partial_ord_impl_on_ord_type)]
impl<T: TName> PartialOrd for UniqueSet<T> {
fn partial_cmp(&self, other: &UniqueSet<T>) -> Option<Ordering> {
(self.0).0.keys().partial_cmp((other.0).0.keys())
Expand Down
2 changes: 1 addition & 1 deletion move-core/types/src/gas_algebra.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ impl<U> Eq for GasQuantity<U> {}

impl<U> PartialOrd for GasQuantity<U> {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
Some(self.cmp_impl(other))
Some(std::cmp::Ord::cmp(self, other))
}
}

Expand Down

0 comments on commit b18005b

Please sign in to comment.