X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=library%2Fstd%2Fsrc%2Fsys%2Fwindows%2Fprocess.rs;h=c6f641d0932bf4bb0aeaa514c8d718a4176b6d7c;hb=a11e2b1f755e392e7c776b98e76aa86a30b7b22e;hp=5ad570427978e5244b0d8d9f4af8c9ae3488d77b;hpb=f372476d2cd19fbd4baff24e767f5ee3d8264b49;p=rust.git diff --git a/library/std/src/sys/windows/process.rs b/library/std/src/sys/windows/process.rs index 5ad57042797..c6f641d0932 100644 --- a/library/std/src/sys/windows/process.rs +++ b/library/std/src/sys/windows/process.rs @@ -149,7 +149,7 @@ fn as_ref(&self) -> &OsStr { fn ensure_no_nuls>(str: T) -> io::Result { if str.as_ref().encode_wide().any(|b| b == 0) { - Err(io::Error::new_const(ErrorKind::InvalidInput, &"nul byte found in provided data")) + Err(io::const_io_error!(ErrorKind::InvalidInput, "nul byte found in provided data")) } else { Ok(str) } @@ -369,9 +369,9 @@ fn resolve_exe<'a>( ) -> io::Result { // Early return if there is no filename. if exe_path.is_empty() || path::has_trailing_slash(exe_path) { - return Err(io::Error::new_const( + return Err(io::const_io_error!( io::ErrorKind::InvalidInput, - &"program path has no file name", + "program path has no file name", )); } // Test if the file name has the `exe` extension. @@ -422,7 +422,7 @@ fn resolve_exe<'a>( } } // If we get here then the executable cannot be found. - Err(io::Error::new_const(io::ErrorKind::NotFound, &"program not found")) + Err(io::const_io_error!(io::ErrorKind::NotFound, "program not found")) } // Calls `f` for every path that should be used to find an executable.