We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
find_map
strip_suffix
find
map
split
--driver-mode=…
1 parent bf4dcf7 commit 4e1c4e6Copy full SHA for 4e1c4e6
src/lib.rs
@@ -2755,10 +2755,7 @@ impl Build {
2755
.map(|(tool, wrapper, args)| {
2756
// find the driver mode, if any
2757
const DRIVER_MODE: &str = "--driver-mode=";
2758
- let driver_mode = args
2759
- .iter()
2760
- .find(|a| a.starts_with(DRIVER_MODE))
2761
- .map(|a| &a[DRIVER_MODE.len()..]);
+ let driver_mode = args.iter().find_map(|a| a.strip_suffix(DRIVER_MODE));
2762
// Chop off leading/trailing whitespace to work around
2763
// semi-buggy build scripts which are shared in
2764
// makefiles/configure scripts (where spaces are far more
0 commit comments