summaryrefslogtreecommitdiff
path: root/src/net/if_.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/if_.rs')
-rw-r--r--src/net/if_.rs2
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())