[pbs-devel] [PATCH proxmox 03/15] clippy fix: calls to `drop` with a value that implements `Copy`

Lukas Wagner l.wagner at proxmox.com
Tue Aug 8 10:01:41 CEST 2023


Dropping a copy leaves the original intact

See:
https://rust-lang.github.io/rust-clippy/master/index.html#drop_copy

I assume the `drop` was used to silence a 'unused variable' warning,
so I silenced it by other means.

Signed-off-by: Lukas Wagner <l.wagner at proxmox.com>
---
 proxmox-rest-server/src/connection.rs | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/proxmox-rest-server/src/connection.rs b/proxmox-rest-server/src/connection.rs
index 7681f00..1bec28d 100644
--- a/proxmox-rest-server/src/connection.rs
+++ b/proxmox-rest-server/src/connection.rs
@@ -226,7 +226,9 @@ impl AcceptBuilder {
                 _ =  shutdown_future => break,
             };
             #[cfg(not(feature = "rate-limited-stream"))]
-            drop(peer);
+            {
+                let _ = &peer;
+            }
 
             sock.set_nodelay(true).unwrap();
             let _ = proxmox_sys::linux::socket::set_tcp_keepalive(
-- 
2.39.2






More information about the pbs-devel mailing list