diff options
| author | bors <bors@rust-lang.org> | 2018-07-24 03:01:11 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-07-24 03:01:11 +0000 |
| commit | baba5007bf857b4577a8d26de454a03d7afef3ac (patch) | |
| tree | 0e552f1865570b25ddabb354b6c6119f8979b866 /src/libsyntax_ext | |
| parent | e842dea7a3d9babc7a19bd201711f4243840fab0 (diff) | |
| parent | 3efc612a930822ea1b9c6749a3d146235c324a83 (diff) | |
| download | rust-baba5007bf857b4577a8d26de454a03d7afef3ac.tar.gz rust-baba5007bf857b4577a8d26de454a03d7afef3ac.zip | |
Auto merge of #52655 - kennytm:rollup, r=kennytm
Rollup of 10 pull requests Successful merges: - #52538 (Remove obsolete flags in the i586_musl Dockerfile) - #52548 (Cursor: update docs to clarify Cursor only works with in-memory buffers) - #52605 (Do not suggest using `to_owned()` on `&str += &str`) - #52621 (Fix color detection for Windows msys terminals.) - #52622 (Use MultiSpan in E0707 and E709) - #52627 (Compile rustc before building tests for rustdoc) - #52637 (Don't use NonNull::dangling as sentinel value in Rc, Arc) - #52640 (Forget Waker when cloning LocalWaker) - #52641 (Simplify 2 functions in rustc_mir/dataflow) - #52642 (Replace a few expect+format combos with unwrap_or_else+panic) Failed merges: r? @ghost
Diffstat (limited to 'src/libsyntax_ext')
| -rw-r--r-- | src/libsyntax_ext/format_foreign.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsyntax_ext/format_foreign.rs b/src/libsyntax_ext/format_foreign.rs index ff9663cdd3c..8ccb3be1ad9 100644 --- a/src/libsyntax_ext/format_foreign.rs +++ b/src/libsyntax_ext/format_foreign.rs @@ -232,11 +232,11 @@ pub mod printf { impl Num { fn from_str(s: &str, arg: Option<&str>) -> Self { if let Some(arg) = arg { - Num::Arg(arg.parse().expect(&format!("invalid format arg `{:?}`", arg))) + Num::Arg(arg.parse().unwrap_or_else(|_| panic!("invalid format arg `{:?}`", arg))) } else if s == "*" { Num::Next } else { - Num::Num(s.parse().expect(&format!("invalid format num `{:?}`", s))) + Num::Num(s.parse().unwrap_or_else(|_| panic!("invalid format num `{:?}`", s))) } } |
