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/net/if_.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/net/if_.rs')
-rw-r--r-- | src/net/if_.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/net/if_.rs b/src/net/if_.rs index 714eac77..58d677ae 100644 --- a/src/net/if_.rs +++ b/src/net/if_.rs @@ -9,7 +9,7 @@ use {Result, Error, NixPath}; /// Resolve an interface into a interface number. pub fn if_nametoindex<P: ?Sized + NixPath>(name: &P) -> Result<c_uint> { - let if_index = try!(name.with_nix_path(|name| unsafe { libc::if_nametoindex(name.as_ptr()) })); + let if_index = name.with_nix_path(|name| unsafe { libc::if_nametoindex(name.as_ptr()) })?; if if_index == 0 { Err(Error::last()) |