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/mount.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/mount.rs') diff --git a/src/mount.rs b/src/mount.rs index 8fe99513..72b719d7 100644 --- a/src/mount.rs +++ b/src/mount.rs @@ -63,7 +63,7 @@ pub fn mount) -> Result<()> { use libc; - let res = try!(try!(try!(try!( + let res = source.with_nix_path(|source| { target.with_nix_path(|target| { fstype.with_nix_path(|fstype| { @@ -78,23 +78,23 @@ pub fn mount(target: &P) -> Result<()> { - let res = try!(target.with_nix_path(|cstr| { + let res = target.with_nix_path(|cstr| { unsafe { libc::umount(cstr.as_ptr()) } - })); + })?; Errno::result(res).map(drop) } pub fn umount2(target: &P, flags: MntFlags) -> Result<()> { - let res = try!(target.with_nix_path(|cstr| { + let res = target.with_nix_path(|cstr| { unsafe { libc::umount2(cstr.as_ptr(), flags.bits) } - })); + })?; Errno::result(res).map(drop) } -- cgit v1.2.3