diff options
Diffstat (limited to 'library/std/src/sys/unix/process/process_unix.rs')
| -rw-r--r-- | library/std/src/sys/unix/process/process_unix.rs | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/library/std/src/sys/unix/process/process_unix.rs b/library/std/src/sys/unix/process/process_unix.rs index bce35b380e6..9fc2d9fce4d 100644 --- a/library/std/src/sys/unix/process/process_unix.rs +++ b/library/std/src/sys/unix/process/process_unix.rs @@ -44,9 +44,9 @@ impl Command { let envp = self.capture_env(); if self.saw_nul() { - return Err(io::Error::new_const( + return Err(io::const_io_error!( ErrorKind::InvalidInput, - &"nul byte found in provided data", + "nul byte found in provided data", )); } @@ -222,10 +222,7 @@ impl Command { let envp = self.capture_env(); if self.saw_nul() { - return io::Error::new_const( - ErrorKind::InvalidInput, - &"nul byte found in provided data", - ); + return io::const_io_error!(ErrorKind::InvalidInput, "nul byte found in provided data",); } match self.setup_io(default, true) { @@ -581,9 +578,9 @@ impl Process { // and used for another process, and we probably shouldn't be killing // random processes, so just return an error. if self.status.is_some() { - Err(Error::new_const( + Err(io::const_io_error!( ErrorKind::InvalidInput, - &"invalid argument: can't kill an exited process", + "invalid argument: can't kill an exited process", )) } else { cvt(unsafe { libc::kill(self.pid, libc::SIGKILL) }).map(drop) |
