Skip to content

Commit 3410596

Browse files
committed
fix: remove useless OwnedFd::from conversion (clippy)
Signed-off-by: danbugs <danilochiarlone@gmail.com>
1 parent 9a59732 commit 3410596

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

host/src/stderr_capture.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ mod imp {
2828
.lock()
2929
.unwrap_or_else(|poisoned| poisoned.into_inner());
3030
let capture_file = std::fs::File::create(path)?;
31-
let original_stderr =
32-
OwnedFd::from(unistd::dup(2).map(|fd| unsafe { OwnedFd::from_raw_fd(fd) })?);
31+
let original_stderr = unistd::dup(2).map(|fd| unsafe { OwnedFd::from_raw_fd(fd) })?;
3332
unistd::dup2(capture_file.as_raw_fd(), 2)?;
3433
// capture_file dropped here — its OwnedFd closes the fd via RAII
3534
Ok(Self {

0 commit comments

Comments
 (0)