rust-clippy: fix remaining warnings in `hg-cpython`
authorRaphaël Gomès <rgomes@octobus.net>
Mon, 09 Jan 2023 19:37:05 +0100
changeset 50006 be3b545c5cff
parent 50005 136aa80aa8b2
child 50007 83437ad8fe3d
rust-clippy: fix remaining warnings in `hg-cpython`
rust/hg-cpython/src/copy_tracing.rs
rust/hg-cpython/src/pybytes_deref.rs
--- a/rust/hg-cpython/src/copy_tracing.rs	Mon Jan 09 19:36:41 2023 +0100
+++ b/rust/hg-cpython/src/copy_tracing.rs	Mon Jan 09 19:37:05 2023 +0100
@@ -103,7 +103,7 @@
                 // thread can drop it. Otherwise the GIL would be implicitly
                 // acquired here through `impl Drop for PyBytes`.
                 if let Some(bytes) = opt_bytes {
-                    if let Err(_) = pybytes_sender.send(bytes.unwrap()) {
+                    if pybytes_sender.send(bytes.unwrap()).is_err() {
                         // The channel is disconnected, meaning the parent
                         // thread panicked or returned
                         // early through
--- a/rust/hg-cpython/src/pybytes_deref.rs	Mon Jan 09 19:36:41 2023 +0100
+++ b/rust/hg-cpython/src/pybytes_deref.rs	Mon Jan 09 19:37:05 2023 +0100
@@ -47,6 +47,7 @@
 
 #[allow(unused)]
 fn static_assert_pybytes_is_send() {
+    #[allow(clippy::no_effect)]
     require_send::<PyBytes>;
 }