Use strip_prefix

This commit is contained in:
bjorn3 2021-07-29 11:54:39 +02:00
parent cd6c0e4e3b
commit 2f6662da85

View File

@ -764,13 +764,7 @@ fn unw(x: Option<&str>) -> &str {
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();
}
}