From 71478e067be8ce1a7cf9f5ec3ed654f8c204017f Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Thu, 17 Dec 2020 13:18:23 -0500 Subject: Update crates/project_model/src/cargo_workspace.rs Co-authored-by: Aleksey Kladov --- crates/project_model/src/cargo_workspace.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/project_model/src') diff --git a/crates/project_model/src/cargo_workspace.rs b/crates/project_model/src/cargo_workspace.rs index 91fb645da..4d339d9c0 100644 --- a/crates/project_model/src/cargo_workspace.rs +++ b/crates/project_model/src/cargo_workspace.rs @@ -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 { -- cgit v1.2.3