diff options
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/fs/mod.rs | 2 | ||||
| -rw-r--r-- | src/libstd/io/cursor.rs | 2 | ||||
| -rw-r--r-- | src/libstd/net/addr.rs | 2 | ||||
| -rw-r--r-- | src/libstd/old_io/fs.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sync/mpsc/mod.rs | 2 | ||||
| -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 | ||||
| -rw-r--r-- | src/libstd/thread.rs | 8 |
11 files changed, 15 insertions, 15 deletions
diff --git a/src/libstd/fs/mod.rs b/src/libstd/fs/mod.rs index ba89b3a0ea6..b02f68c1630 100644 --- a/src/libstd/fs/mod.rs +++ b/src/libstd/fs/mod.rs @@ -1532,7 +1532,7 @@ mod tests { #[test] fn binary_file() { let mut bytes = [0; 1024]; - StdRng::new().ok().unwrap().fill_bytes(&mut bytes); + StdRng::new().unwrap().fill_bytes(&mut bytes); let tmpdir = tmpdir(); diff --git a/src/libstd/io/cursor.rs b/src/libstd/io/cursor.rs index 365f5e37b0b..87e5a2a4488 100644 --- a/src/libstd/io/cursor.rs +++ b/src/libstd/io/cursor.rs @@ -277,7 +277,7 @@ mod tests { fn read_to_end() { let mut reader = Cursor::new(vec!(0, 1, 2, 3, 4, 5, 6, 7)); let mut v = Vec::new(); - reader.read_to_end(&mut v).ok().unwrap(); + reader.read_to_end(&mut v).unwrap(); assert_eq!(v, [0, 1, 2, 3, 4, 5, 6, 7]); } diff --git a/src/libstd/net/addr.rs b/src/libstd/net/addr.rs index 702f81db8e2..87241117043 100644 --- a/src/libstd/net/addr.rs +++ b/src/libstd/net/addr.rs @@ -617,7 +617,7 @@ mod tests { unique_local: bool, global: bool, u_link_local: bool, u_site_local: bool, u_global: bool, m_scope: Option<Ipv6MulticastScope>) { - let ip: Ipv6Addr = str_addr.parse().ok().unwrap(); + let ip: Ipv6Addr = str_addr.parse().unwrap(); assert_eq!(str_addr, ip.to_string()); assert_eq!(ip.is_unspecified(), unspec); diff --git a/src/libstd/old_io/fs.rs b/src/libstd/old_io/fs.rs index 2df925beb36..980406b1ce9 100644 --- a/src/libstd/old_io/fs.rs +++ b/src/libstd/old_io/fs.rs @@ -1608,7 +1608,7 @@ mod test { use rand::{StdRng, Rng}; let mut bytes = [0; 1024]; - StdRng::new().ok().unwrap().fill_bytes(&mut bytes); + StdRng::new().unwrap().fill_bytes(&mut bytes); let tmpdir = tmpdir(); diff --git a/src/libstd/sync/mpsc/mod.rs b/src/libstd/sync/mpsc/mod.rs index 01eeed4fb54..123dad978f5 100644 --- a/src/libstd/sync/mpsc/mod.rs +++ b/src/libstd/sync/mpsc/mod.rs @@ -592,7 +592,7 @@ impl<T: Send> Sender<T> { // asleep (we're looking at it), so the receiver // can't go away. (*a.get()).send(t).ok().unwrap(); - token.signal(); + token.signal(); (a, Ok(())) } } 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 ef0274fdda9..c830eb91068 100644 --- a/src/libstd/sys/unix/timer.rs +++ b/src/libstd/sys/unix/timer.rs @@ -197,7 +197,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(), diff --git a/src/libstd/thread.rs b/src/libstd/thread.rs index d2742d4b45a..99414c771f0 100644 --- a/src/libstd/thread.rs +++ b/src/libstd/thread.rs @@ -869,7 +869,7 @@ mod test { Err(e) => { type T = &'static str; assert!(e.is::<T>()); - assert_eq!(*e.downcast::<T>().ok().unwrap(), "static string"); + assert_eq!(*e.downcast::<T>().unwrap(), "static string"); } Ok(()) => panic!() } @@ -883,7 +883,7 @@ mod test { Err(e) => { type T = String; assert!(e.is::<T>()); - assert_eq!(*e.downcast::<T>().ok().unwrap(), "owned string".to_string()); + assert_eq!(*e.downcast::<T>().unwrap(), "owned string".to_string()); } Ok(()) => panic!() } @@ -897,9 +897,9 @@ mod test { Err(e) => { type T = Box<Any + Send>; assert!(e.is::<T>()); - let any = e.downcast::<T>().ok().unwrap(); + let any = e.downcast::<T>().unwrap(); assert!(any.is::<u16>()); - assert_eq!(*any.downcast::<u16>().ok().unwrap(), 413); + assert_eq!(*any.downcast::<u16>().unwrap(), 413); } Ok(()) => panic!() } |
