diff options
| author | bjorn3 <bjorn3@users.noreply.github.com> | 2021-07-29 11:54:39 +0200 |
|---|---|---|
| committer | bjorn3 <bjorn3@users.noreply.github.com> | 2021-07-29 11:54:39 +0200 |
| commit | 2f6662da85d47ebf89432c910a496812e9e2db12 (patch) | |
| tree | 036753c4b8764efefd8cb9e2e8431149fe7f5244 | |
| parent | cd6c0e4e3b71cffd6e577146cbf989ad6ba29c63 (diff) | |
| download | rust-2f6662da85d47ebf89432c910a496812e9e2db12.tar.gz rust-2f6662da85d47ebf89432c910a496812e9e2db12.zip | |
Use strip_prefix
| -rw-r--r-- | compiler/rustc_driver/src/lib.rs | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/compiler/rustc_driver/src/lib.rs b/compiler/rustc_driver/src/lib.rs index 50932d498b3..84dd69ebd96 100644 --- a/compiler/rustc_driver/src/lib.rs +++ b/compiler/rustc_driver/src/lib.rs @@ -764,13 +764,7 @@ pub fn version(binary: &str, matches: &getopts::Matches) { println!("release: {}", unw(util::release_str())); let debug_flags = matches.opt_strs("Z"); - let backend_name = debug_flags.iter().find_map(|x| { - if x.starts_with("codegen-backend=") { - Some(&x["codegen-backend=".len()..]) - } else { - None - } - }); + let backend_name = debug_flags.iter().find_map(|x| x.strip_prefix("codegen-backend=")); get_codegen_backend(&None, backend_name).print_version(); } } |
