diff --git a/xtask/src/submodules.rs b/xtask/src/submodules.rs index ab06f43df..1f369d38e 100644 --- a/xtask/src/submodules.rs +++ b/xtask/src/submodules.rs @@ -144,7 +144,9 @@ fn all_submodules() -> Result> { let mut pb = vec![]; for kv in out.stdout.split(|n| *n == 0).filter(|v| !v.is_empty()) { if let Ok(v) = std::str::from_utf8(kv) { - if let Some((_, path)) = v.split_once('\n') { + // `v` is formatted like "{name}\n{path}", so discard everything up + // to (and including) the newline. + if let Some(path) = v.find('\n').map(|p| &v[(p + 1)..]) { pb.push(path.into()); } else { eprintln!(