From fd7d3420d32e42c73063d82d331e9831fbcb47a6 Mon Sep 17 00:00:00 2001 From: Guanqun Lu Date: Sun, 10 Nov 2019 15:41:04 +0800 Subject: [PATCH] make the error message more readable --- src/bootstrap/flags.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bootstrap/flags.rs b/src/bootstrap/flags.rs index d9580b598155e..7b49cc0a9298c 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::>(), 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"))