From ee3647c712c92715b3ff02d9f8b798eec3208fa0 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Sun, 27 Aug 2023 21:51:06 +0200 Subject: [PATCH] Appease clippy --- .github/workflows/ci.yml | 3 ++- crates/icrate/src/Foundation/additions/string.rs | 2 +- crates/icrate/tests/exception.rs | 2 +- crates/objc2/src/rc/id.rs | 2 ++ 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 200ecf9f7..3c8b3c297 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -150,7 +150,8 @@ jobs: run: cargo doc --no-deps --document-private-items ${{ matrix.args }} - name: cargo clippy - run: cargo clippy --all-targets ${{ matrix.args }} + # Temporarily allow diverging_sub_expression until we figure out how to silence them in declare_class! + run: cargo clippy --all-targets ${{ matrix.args }} -- --allow=clippy::diverging_sub_expression msrv: name: Check MSRV diff --git a/crates/icrate/src/Foundation/additions/string.rs b/crates/icrate/src/Foundation/additions/string.rs index a94156a72..e893348ae 100644 --- a/crates/icrate/src/Foundation/additions/string.rs +++ b/crates/icrate/src/Foundation/additions/string.rs @@ -192,7 +192,7 @@ impl Ord for NSString { impl PartialOrd for NSMutableString { #[inline] fn partial_cmp(&self, other: &Self) -> Option { - PartialOrd::partial_cmp(&**self, &**other) + Some(self.cmp(other)) } } diff --git a/crates/icrate/tests/exception.rs b/crates/icrate/tests/exception.rs index 6a14baac1..f3123978e 100644 --- a/crates/icrate/tests/exception.rs +++ b/crates/icrate/tests/exception.rs @@ -46,7 +46,7 @@ fn unwrap() { ) .unwrap(); - let _: () = Err(exc).unwrap(); + let _: () = panic!("{exc:?}"); } // Further tests in `tests::exception` diff --git a/crates/objc2/src/rc/id.rs b/crates/objc2/src/rc/id.rs index bb933766d..73012952a 100644 --- a/crates/objc2/src/rc/id.rs +++ b/crates/objc2/src/rc/id.rs @@ -231,6 +231,8 @@ impl Id { /// This is an associated method, and must be called as /// `Id::as_mut_ptr(obj)`. #[inline] + #[allow(unknown_lints)] // New lint below + #[allow(clippy::needless_pass_by_ref_mut)] pub fn as_mut_ptr(this: &mut Self) -> *mut T where T: IsMutable,