Update crates/project_model/src/cargo_workspace.rs

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
Jon Gjengset 2020-12-17 13:18:23 -05:00 committed by GitHub
parent 9802c0ccd0
commit 71478e067b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -179,7 +179,7 @@ impl CargoWorkspace {
Ok(stdout) => {
let field = "host: ";
let target =
stdout.lines().find(|l| l.starts_with(field)).map(|l| &l[field.len()..]);
stdout.lines().find_map(|l| l.strip_prefix(field));
if let Some(target) = target {
Some(target.to_string())
} else {