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/libsyntax | |
| 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/libsyntax')
| -rw-r--r-- | src/libsyntax/ext/deriving/encodable.rs | 6 | ||||
| -rw-r--r-- | src/libsyntax/parse/lexer/mod.rs | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/libsyntax/ext/deriving/encodable.rs b/src/libsyntax/ext/deriving/encodable.rs index d7961d7da00..06255f46779 100644 --- a/src/libsyntax/ext/deriving/encodable.rs +++ b/src/libsyntax/ext/deriving/encodable.rs @@ -64,7 +64,7 @@ //! fn encode(&self, s: &mut S) -> Result<(), E> { //! s.emit_struct("Spanned", 2, |this| { //! this.emit_struct_field("node", 0, |this| self.node.encode(this)) -//! .ok().unwrap(); +//! .unwrap(); //! this.emit_struct_field("span", 1, |this| self.span.encode(this)) //! }) //! } @@ -79,9 +79,9 @@ //! d.read_struct("Spanned", 2, |this| { //! Ok(Spanned { //! node: this.read_struct_field("node", 0, |this| Decodable::decode(this)) -//! .ok().unwrap(), +//! .unwrap(), //! span: this.read_struct_field("span", 1, |this| Decodable::decode(this)) -//! .ok().unwrap(), +//! .unwrap(), //! }) //! }) //! } diff --git a/src/libsyntax/parse/lexer/mod.rs b/src/libsyntax/parse/lexer/mod.rs index bb8f9da8917..e0953a8ace6 100644 --- a/src/libsyntax/parse/lexer/mod.rs +++ b/src/libsyntax/parse/lexer/mod.rs @@ -623,7 +623,7 @@ impl<'a> StringReader<'a> { // find the integer representing the name self.scan_digits(base); let encoded_name : u32 = self.with_str_from(start_bpos, |s| { - num::from_str_radix(s, 10).ok().unwrap_or_else(|| { + num::from_str_radix(s, 10).unwrap_or_else(|_| { panic!("expected digits representing a name, got {:?}, {}, range [{:?},{:?}]", s, whence, start_bpos, self.last_pos); }) @@ -641,7 +641,7 @@ impl<'a> StringReader<'a> { let start_bpos = self.last_pos; self.scan_digits(base); let encoded_ctxt : ast::SyntaxContext = self.with_str_from(start_bpos, |s| { - num::from_str_radix(s, 10).ok().unwrap_or_else(|| { + num::from_str_radix(s, 10).unwrap_or_else(|_| { panic!("expected digits representing a ctxt, got {:?}, {}", s, whence); }) }); |
