diff options
| author | bors <bors@rust-lang.org> | 2015-03-20 23:16:47 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-03-20 23:16:47 +0000 |
| commit | e2fa53e593a854a609ae9efe5a1bbe15265f0a6f (patch) | |
| tree | 31d6cf6dcb795deb1b8bda95d58cfbf02002000b /src/libstd/sys | |
| parent | 68d69415637186755482d2584e6ba82b67bc1d89 (diff) | |
| parent | b4a1e59146c70a12d8c4c1f85c08a2ecf9fb3d2e (diff) | |
| download | rust-e2fa53e593a854a609ae9efe5a1bbe15265f0a6f.tar.gz rust-e2fa53e593a854a609ae9efe5a1bbe15265f0a6f.zip | |
Auto merge of #23512 - oli-obk:result_ok_unwrap, r=alexcrichton
because then the call to `unwrap()` will not print the error object.
Diffstat (limited to 'src/libstd/sys')
| -rw-r--r-- | src/libstd/sys/unix/backtrace.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/unix/fs.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/unix/helper_signal.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/unix/timer.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/windows/pipe.rs | 4 |
5 files changed, 6 insertions, 6 deletions
diff --git a/src/libstd/sys/unix/backtrace.rs b/src/libstd/sys/unix/backtrace.rs index 74ab04978cb..7db64cfb936 100644 --- a/src/libstd/sys/unix/backtrace.rs +++ b/src/libstd/sys/unix/backtrace.rs @@ -454,7 +454,7 @@ fn output(w: &mut Write, idx: int, addr: *mut libc::c_void, #[allow(dead_code)] fn output_fileline(w: &mut Write, file: &[u8], line: libc::c_int, more: bool) -> io::Result<()> { - let file = str::from_utf8(file).ok().unwrap_or("<unknown>"); + let file = str::from_utf8(file).unwrap_or("<unknown>"); // prior line: " ##: {:2$} - func" try!(write!(w, " {:3$}at {}:{}", "", file, line, HEX_WIDTH)); if more { diff --git a/src/libstd/sys/unix/fs.rs b/src/libstd/sys/unix/fs.rs index c839ce65298..a3d495f82ef 100644 --- a/src/libstd/sys/unix/fs.rs +++ b/src/libstd/sys/unix/fs.rs @@ -391,7 +391,7 @@ mod tests { let mut reader = FileDesc::new(reader, true); let mut writer = FileDesc::new(writer, true); - writer.write(b"test").ok().unwrap(); + writer.write(b"test").unwrap(); let mut buf = [0; 4]; match reader.read(&mut buf) { Ok(4) => { diff --git a/src/libstd/sys/unix/helper_signal.rs b/src/libstd/sys/unix/helper_signal.rs index ff29dea254f..17c8b21f8b3 100644 --- a/src/libstd/sys/unix/helper_signal.rs +++ b/src/libstd/sys/unix/helper_signal.rs @@ -23,7 +23,7 @@ pub fn new() -> (signal, signal) { } pub fn signal(fd: libc::c_int) { - FileDesc::new(fd, false).write(&[0]).ok().unwrap(); + FileDesc::new(fd, false).write(&[0]).unwrap(); } pub fn close(fd: libc::c_int) { diff --git a/src/libstd/sys/unix/timer.rs b/src/libstd/sys/unix/timer.rs index ef175d68fc4..b6d2aca9a52 100644 --- a/src/libstd/sys/unix/timer.rs +++ b/src/libstd/sys/unix/timer.rs @@ -204,7 +204,7 @@ fn helper(input: libc::c_int, messages: Receiver<Req>, _: ()) { // drain the file descriptor let mut buf = [0]; - assert_eq!(fd.read(&mut buf).ok().unwrap(), 1); + assert_eq!(fd.read(&mut buf).unwrap(), 1); } -1 if os::errno() == libc::EINTR as i32 => {} diff --git a/src/libstd/sys/windows/pipe.rs b/src/libstd/sys/windows/pipe.rs index 2b03e9e7431..17fdd6755c6 100644 --- a/src/libstd/sys/windows/pipe.rs +++ b/src/libstd/sys/windows/pipe.rs @@ -757,10 +757,10 @@ impl UnixAcceptor { impl Clone for UnixAcceptor { fn clone(&self) -> UnixAcceptor { - let name = to_utf16(&self.listener.name).ok().unwrap(); + let name = to_utf16(&self.listener.name).unwrap(); UnixAcceptor { inner: self.inner.clone(), - event: Event::new(true, false).ok().unwrap(), + event: Event::new(true, false).unwrap(), deadline: 0, listener: UnixListener { name: self.listener.name.clone(), |
