changeset 49933:be3b545c5cff

rust-clippy: fix remaining warnings in `hg-cpython`
author Raphaël Gomès <rgomes@octobus.net>
date Mon, 09 Jan 2023 19:37:05 +0100
parents 136aa80aa8b2
children 83437ad8fe3d
files rust/hg-cpython/src/copy_tracing.rs rust/hg-cpython/src/pybytes_deref.rs
diffstat 2 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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>;
 }