diff options
Diffstat (limited to 'src/sys/socket/addr.rs')
-rw-r--r-- | src/sys/socket/addr.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/sys/socket/addr.rs b/src/sys/socket/addr.rs index ebd32c1f..b2cafe3c 100644 --- a/src/sys/socket/addr.rs +++ b/src/sys/socket/addr.rs @@ -600,7 +600,7 @@ pub struct UnixAddr(pub libc::sockaddr_un, pub usize); impl UnixAddr { /// Create a new sockaddr_un representing a filesystem path. pub fn new<P: ?Sized + NixPath>(path: &P) -> Result<UnixAddr> { - try!(path.with_nix_path(|cstr| { + path.with_nix_path(|cstr| { unsafe { let mut ret = libc::sockaddr_un { sun_family: AddressFamily::Unix as sa_family_t, @@ -619,7 +619,7 @@ impl UnixAddr { Ok(UnixAddr(ret, bytes.len())) } - })) + })? } /// Create a new `sockaddr_un` representing an address in the "abstract namespace". @@ -759,7 +759,7 @@ impl SockAddr { } pub fn new_unix<P: ?Sized + NixPath>(path: &P) -> Result<SockAddr> { - Ok(SockAddr::Unix(try!(UnixAddr::new(path)))) + Ok(SockAddr::Unix(UnixAddr::new(path)?)) } #[cfg(any(target_os = "android", target_os = "linux"))] @@ -1079,7 +1079,7 @@ pub mod sys_control { ctl_name[..name.len()].clone_from_slice(name.as_bytes()); let mut info = ctl_ioc_info { ctl_id: 0, ctl_name: ctl_name }; - unsafe { try!(ctl_info(sockfd, &mut info)); } + unsafe { ctl_info(sockfd, &mut info)?; } Ok(SysControlAddr::new(info.ctl_id, unit)) } |