about summary refs log tree commit diff
path: root/src/compiletest/errors.rs
diff options
context:
space:
mode:
authorCorey Farwell <coreyf@rwell.org>2016-03-09 21:44:35 -0800
committerCorey Farwell <coreyf@rwell.org>2016-03-09 23:24:50 -0800
commite1048b5ab64cceba5ce8edb1f41614e063edb78d (patch)
treec742a3d193ae2054f0a067d2fcd1533f59b39808 /src/compiletest/errors.rs
parent0b9995b24ccc7489e0082199793c300015753dd1 (diff)
downloadrust-e1048b5ab64cceba5ce8edb1f41614e063edb78d.tar.gz
rust-e1048b5ab64cceba5ce8edb1f41614e063edb78d.zip
Prefer `Option::expect` over explicit unwrapping.
Diffstat (limited to 'src/compiletest/errors.rs')
-rw-r--r--src/compiletest/errors.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/compiletest/errors.rs b/src/compiletest/errors.rs
index 44634e4d565..264e32f1d06 100644
--- a/src/compiletest/errors.rs
+++ b/src/compiletest/errors.rs
@@ -93,9 +93,8 @@ fn parse_expected(last_nonfollow_error: Option<usize>,
 
     let (which, line) = if follow {
         assert!(adjusts == 0, "use either //~| or //~^, not both.");
-        let line = last_nonfollow_error.unwrap_or_else(|| {
-            panic!("encountered //~| without preceding //~^ line.")
-        });
+        let line = last_nonfollow_error.expect("encountered //~| without \
+                                                preceding //~^ line.");
         (FollowPrevious(line), line)
     } else {
         let which =