diff options
author | Alan Somers <asomers@gmail.com> | 2018-12-08 13:47:33 -0700 |
---|---|---|
committer | Alan Somers <asomers@gmail.com> | 2018-12-08 13:51:43 -0700 |
commit | ca035734df2e3dfeb866cbfee51de7b582be83f5 (patch) | |
tree | dbbf94ee5189b13ea4d448ba63512b43f85b4ba8 /src/net | |
parent | 5a3ac8df3fa2de86477d961d8b5720b1d283b2d5 (diff) | |
download | nix-ca035734df2e3dfeb866cbfee51de7b582be83f5.zip |
Replace try! with ?
try! is not available in Rust 2018
Diffstat (limited to 'src/net')
-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()) |