about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev@gmail.com>2019-11-12 16:36:08 +0900
committerGitHub <noreply@github.com>2019-11-12 16:36:08 +0900
commit896484c71fa6fb9e0b9ed61795e21cc6a13ba801 (patch)
treeeacf2926472adef43b9163fa44918c03e8332eb4 /src/bootstrap
parent7596d34ea13b9401635fb159af9c1fd8df5adc78 (diff)
parentfd7d3420d32e42c73063d82d331e9831fbcb47a6 (diff)
Rollup merge of #66263 - guanqun:make-error-explicit, r=alexcrichton
make the error message more readable

When I type it wrong e.g. `--stage --bless`, missing a number here, this change would make it more explicit what's going wrong here.
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/flags.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bootstrap/flags.rs b/src/bootstrap/flags.rs
index d9580b59815..7b49cc0a929 100644
--- a/src/bootstrap/flags.rs
+++ b/src/bootstrap/flags.rs
@@ -448,12 +448,12 @@ Arguments:
 
         Flags {
             verbose: matches.opt_count("verbose"),
-            stage: matches.opt_str("stage").map(|j| j.parse().unwrap()),
+            stage: matches.opt_str("stage").map(|j| j.parse().expect("`stage` should be a number")),
             dry_run: matches.opt_present("dry-run"),
             on_fail: matches.opt_str("on-fail"),
             rustc_error_format: matches.opt_str("error-format"),
             keep_stage: matches.opt_strs("keep-stage")
-                .into_iter().map(|j| j.parse().unwrap())
+                .into_iter().map(|j| j.parse().expect("`keep-stage` should be a number"))
                 .collect(),
             host: split(&matches.opt_strs("host"))
                 .into_iter()
@@ -464,7 +464,7 @@ Arguments:
                 .map(|x| INTERNER.intern_string(x))
                 .collect::<Vec<_>>(),
             config: cfg_file,
-            jobs: matches.opt_str("jobs").map(|j| j.parse().unwrap()),
+            jobs: matches.opt_str("jobs").map(|j| j.parse().expect("`jobs` should be a number")),
             cmd,
             incremental: matches.opt_present("incremental"),
             exclude: split(&matches.opt_strs("exclude"))