Skip to content

Commit

Permalink
Fix use of not-quite-stabilized API, and explain what the line did an…
Browse files Browse the repository at this point in the history
…yway
  • Loading branch information
thomcc committed Apr 6, 2021
1 parent b489bb2 commit a78fb45
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion xtask/src/submodules.rs
Expand Up @@ -144,7 +144,9 @@ fn all_submodules() -> Result<Vec<PathBuf>> {
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!(
Expand Down

0 comments on commit a78fb45

Please sign in to comment.