]> git.proxmox.com Git - proxmox.git/commitdiff
clippy fix: calls to `drop` with a value that implements `Copy`
authorLukas Wagner <l.wagner@proxmox.com>
Tue, 8 Aug 2023 08:01:41 +0000 (10:01 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 8 Aug 2023 09:29:36 +0000 (11:29 +0200)
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@proxmox.com>
proxmox-rest-server/src/connection.rs

index 7681f00c25c2af0efa5fdecd881cdc8db99d7537..1bec28d39ea0ae986b21df5f3ca70f61e5817be1 100644 (file)
@@ -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(