Skip to content

Commit 06e28c4

Browse files
jschweemilio
authored andcommitted
Fix clippy: stripping a prefix manually
1 parent ee2223f commit 06e28c4

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/bindgen/cargo/cargo_metadata.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -202,14 +202,9 @@ fn discover_target(manifest_path: &Path) -> Option<String> {
202202
};
203203

204204
let field = "host: ";
205-
rustc_output.lines().find_map(|l| {
206-
// XXX l.strip_prefix(field) re-implemented to preserve MSRV
207-
if l.starts_with(field) {
208-
Some(l[field.len()..].into())
209-
} else {
210-
None
211-
}
212-
})
205+
rustc_output
206+
.lines()
207+
.find_map(|l| l.strip_prefix(field).map(|stripped| stripped.to_string()))
213208
}
214209

215210
/// The main entry point to obtaining metadata

0 commit comments

Comments
 (0)