Skip to content

Commit 65c4f02

Browse files
committed
fix: let_underscore_drop
1 parent 138c6fc commit 65c4f02

4 files changed

Lines changed: 6 additions & 3 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,7 @@ exclude = [
394394

395395
[workspace.lints.rust]
396396
# Lint groups
397+
let_underscore = "warn"
397398
rust_2018_idioms = "warn"
398399

399400
# Lints

src/executor/vsock.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ impl VsockMap {
207207
}
208208

209209
pub fn remove_socket(&mut self, port: u32) {
210-
let _ = self.port_map.remove(&port);
210+
self.port_map.remove(&port);
211211
}
212212
}
213213

src/fs/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,8 @@ impl Write for File {
612612

613613
impl Drop for File {
614614
fn drop(&mut self) {
615-
let _ = remove_object(self.fd);
615+
if let Err(err) = remove_object(self.fd) {
616+
error!("File::drop failed: {err}");
617+
}
616618
}
617619
}

src/scheduler/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ impl PerCoreScheduler {
512512
};
513513

514514
let fd = new_fd()?;
515-
let _ = object_map.insert(fd, obj.clone());
515+
object_map.insert(fd, obj.clone());
516516
Ok(fd)
517517
})
518518
}

0 commit comments

Comments
 (0)