Remove unnecessary type casts.
This commit is contained in:
@@ -353,7 +353,7 @@ impl IoError {
|
|||||||
/// operating system) between the call(s) for which errors are
|
/// operating system) between the call(s) for which errors are
|
||||||
/// being checked and the call of this function.
|
/// being checked and the call of this function.
|
||||||
pub fn last_error() -> IoError {
|
pub fn last_error() -> IoError {
|
||||||
IoError::from_errno(os::errno() as i32, true)
|
IoError::from_errno(os::errno(), true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -527,12 +527,12 @@ pub fn errno() -> i32 {
|
|||||||
/// println!("{}", os::error_string(os::errno() as i32));
|
/// println!("{}", os::error_string(os::errno() as i32));
|
||||||
/// ```
|
/// ```
|
||||||
pub fn error_string(errnum: i32) -> String {
|
pub fn error_string(errnum: i32) -> String {
|
||||||
return sys::os::error_string(errnum as i32);
|
return sys::os::error_string(errnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get a string representing the platform-dependent last error
|
/// Get a string representing the platform-dependent last error
|
||||||
pub fn last_os_error() -> String {
|
pub fn last_os_error() -> String {
|
||||||
error_string(errno() as i32)
|
error_string(errno())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Sets the process exit code
|
/// Sets the process exit code
|
||||||
|
|||||||
Reference in New Issue
Block a user