From ca035734df2e3dfeb866cbfee51de7b582be83f5 Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Sat, 8 Dec 2018 13:47:33 -0700 Subject: Replace try! with ? try! is not available in Rust 2018 --- src/sys/mman.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/sys/mman.rs') diff --git a/src/sys/mman.rs b/src/sys/mman.rs index 48b5767e..a30629db 100644 --- a/src/sys/mman.rs +++ b/src/sys/mman.rs @@ -264,7 +264,7 @@ pub unsafe fn msync(addr: *mut c_void, length: size_t, flags: MsFlags) -> Result #[cfg(not(target_os = "android"))] pub fn shm_open(name: &P, flag: OFlag, mode: Mode) -> Result { - let ret = try!(name.with_nix_path(|cstr| { + let ret = name.with_nix_path(|cstr| { #[cfg(any(target_os = "macos", target_os = "ios"))] unsafe { libc::shm_open(cstr.as_ptr(), flag.bits(), mode.bits() as libc::c_uint) @@ -273,16 +273,16 @@ pub fn shm_open(name: &P, flag: OFlag, mode: Mode) -> Resul unsafe { libc::shm_open(cstr.as_ptr(), flag.bits(), mode.bits() as libc::mode_t) } - })); + })?; Errno::result(ret) } #[cfg(not(target_os = "android"))] pub fn shm_unlink(name: &P) -> Result<()> { - let ret = try!(name.with_nix_path(|cstr| { + let ret = name.with_nix_path(|cstr| { unsafe { libc::shm_unlink(cstr.as_ptr()) } - })); + })?; Errno::result(ret).map(drop) } -- cgit v1.2.3