std: update internal uses of io::const_error!

This commit is contained in:
joboet
2024-11-25 13:49:25 +01:00
parent d39afacbdf
commit c14d137bfc
53 changed files with 213 additions and 246 deletions

View File

@@ -5,7 +5,7 @@ use crate::io::{self, Error, ErrorKind};
use crate::path::Path;
use crate::sys_common::ignore_notfound;
pub(crate) const NOT_FILE_ERROR: Error = io::const_io_error!(
pub(crate) const NOT_FILE_ERROR: Error = io::const_error!(
ErrorKind::InvalidInput,
"the source path is neither a regular file nor a symlink to a regular file",
);

View File

@@ -122,7 +122,7 @@ pub fn sockaddr_to_addr(storage: &c::sockaddr_storage, len: usize) -> io::Result
*(storage as *const _ as *const c::sockaddr_in6)
})))
}
_ => Err(io::const_io_error!(ErrorKind::InvalidInput, "invalid argument")),
_ => Err(io::const_error!(ErrorKind::InvalidInput, "invalid argument")),
}
}
@@ -185,7 +185,7 @@ impl TryFrom<&str> for LookupHost {
($e:expr, $msg:expr) => {
match $e {
Some(r) => r,
None => return Err(io::const_io_error!(io::ErrorKind::InvalidInput, $msg)),
None => return Err(io::const_error!(io::ErrorKind::InvalidInput, $msg)),
}
};
}