diff options
Diffstat (limited to 'src/libstd/sys/unix/os.rs')
| -rw-r--r-- | src/libstd/sys/unix/os.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libstd/sys/unix/os.rs b/src/libstd/sys/unix/os.rs index d332556d188..75aeafe6e3c 100644 --- a/src/libstd/sys/unix/os.rs +++ b/src/libstd/sys/unix/os.rs @@ -13,7 +13,7 @@ #![allow(unused_imports)] // lots of cfg code here use prelude::v1::*; -use os::unix::*; +use os::unix::prelude::*; use error::Error as StdError; use ffi::{CString, CStr, OsString, OsStr, AsOsStr}; @@ -206,7 +206,7 @@ pub fn current_exe() -> io::Result<PathBuf> { if err != 0 { return Err(io::Error::last_os_error()); } if sz == 0 { return Err(io::Error::last_os_error()); } v.set_len(sz as uint - 1); // chop off trailing NUL - Ok(PathBuf::new::<OsString>(&OsStringExt::from_vec(v))) + Ok(PathBuf::new::<OsString>(OsStringExt::from_vec(v))) } } @@ -232,7 +232,7 @@ pub fn current_exe() -> io::Result<PathBuf> { Err(io::Error::last_os_error()) } else { let vec = CStr::from_ptr(v).to_bytes().to_vec(); - Ok(PathBuf::new::<OsString>(&OsStringExt::from_vec(vec))) + Ok(PathBuf::new::<OsString>(OsStringExt::from_vec(vec))) } } } @@ -253,7 +253,7 @@ pub fn current_exe() -> io::Result<PathBuf> { let err = _NSGetExecutablePath(v.as_mut_ptr() as *mut i8, &mut sz); if err != 0 { return Err(io::Error::last_os_error()); } v.set_len(sz as uint - 1); // chop off trailing NUL - Ok(PathBuf::new::<OsString>(&OsStringExt::from_vec(v))) + Ok(PathBuf::new(OsString::from_vec(v))) } } @@ -286,7 +286,7 @@ pub fn args() -> Args { let vec = unsafe { let (argc, argv) = (*_NSGetArgc() as isize, *_NSGetArgv() as *const *const c_char); - range(0, argc as isize).map(|i| { + (0.. argc as isize).map(|i| { let bytes = CStr::from_ptr(*argv.offset(i)).to_bytes().to_vec(); OsStringExt::from_vec(bytes) }).collect::<Vec<_>>() |
