Skip to content

Commit 080e200

Browse files
committed
style: Make clippy happy
1 parent 8d77e55 commit 080e200

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

src/process.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ impl PtyProcess {
126126
flags.local_flags &= !termios::LocalFlags::ECHO;
127127
termios::tcsetattr(&stdin, termios::SetArg::TCSANOW, &flags)?;
128128

129-
command.exec();
129+
let _ = command.exec();
130130
Err(Error::Nix(nix::Error::last()))
131131
}
132132
ForkResult::Parent { child: child_pid } => Ok(PtyProcess {
@@ -173,11 +173,7 @@ impl PtyProcess {
173173
/// ```
174174
///
175175
pub fn status(&self) -> Option<wait::WaitStatus> {
176-
if let Ok(status) = wait::waitpid(self.child_pid, Some(wait::WaitPidFlag::WNOHANG)) {
177-
Some(status)
178-
} else {
179-
None
180-
}
176+
wait::waitpid(self.child_pid, Some(wait::WaitPidFlag::WNOHANG)).ok()
181177
}
182178

183179
/// Wait until process has exited. This is a blocking call.
@@ -188,7 +184,7 @@ impl PtyProcess {
188184

189185
/// Regularly exit the process, this method is blocking until the process is dead
190186
pub fn exit(&mut self) -> Result<wait::WaitStatus, Error> {
191-
self.kill(signal::SIGTERM).map_err(Error::from)
187+
self.kill(signal::SIGTERM)
192188
}
193189

194190
/// Non-blocking variant of `kill()` (doesn't wait for process to be killed)

0 commit comments

Comments
 (0)