diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-12-09 01:05:23 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-12-09 01:05:23 +0000 |
commit | f1b12d6b1b8bf6d8ad41e7b2967b95c6f876745c (patch) | |
tree | dbbf94ee5189b13ea4d448ba63512b43f85b4ba8 /src/sys/statvfs.rs | |
parent | 5a3ac8df3fa2de86477d961d8b5720b1d283b2d5 (diff) | |
parent | ca035734df2e3dfeb866cbfee51de7b582be83f5 (diff) | |
download | nix-f1b12d6b1b8bf6d8ad41e7b2967b95c6f876745c.zip |
Merge #995
995: Replace try! with ? r=asomers a=asomers
try! is not available in Rust 2018. It would be premature to convert the entire project to Rust 2018, since that would bump the minimum compiler to 1.31.0. But his change will help us when we do convert it eventually.
Co-authored-by: Alan Somers <asomers@gmail.com>
Diffstat (limited to 'src/sys/statvfs.rs')
-rw-r--r-- | src/sys/statvfs.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/sys/statvfs.rs b/src/sys/statvfs.rs index 845ae0db..de69ae51 100644 --- a/src/sys/statvfs.rs +++ b/src/sys/statvfs.rs @@ -126,9 +126,9 @@ pub fn statvfs<P: ?Sized + NixPath>(path: &P) -> Result<Statvfs> { unsafe { Errno::clear(); let mut stat: Statvfs = mem::uninitialized(); - let res = try!( - path.with_nix_path(|path| libc::statvfs(path.as_ptr(), &mut stat.0)) - ); + let res = path.with_nix_path(|path| + libc::statvfs(path.as_ptr(), &mut stat.0) + )?; Errno::result(res).map(|_| stat) } |