chore: Prepare for Rust edition bump to 2024 (without autofix) (#27791)

Successor to #27779 - in this PR I've applied changes manually, without
futzing with if let lifetimes at all.

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2025-03-31 20:10:36 +02:00 committed by GitHub
parent d51aa2ffb0
commit 0729d24d77
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
162 changed files with 2333 additions and 1937 deletions

View file

@ -119,9 +119,13 @@ impl Prettier {
} else {
log::warn!("Skipping path {path_to_check:?} workspace root with workspaces {workspaces:?} that have no prettier installed");
}
},
Some(unknown) => log::error!("Failed to parse workspaces for {path_to_check:?} from package.json, got {unknown:?}. Skipping."),
None => log::warn!("Skipping path {path_to_check:?} that has no prettier dependency and no workspaces section in its package.json"),
}
Some(unknown) => log::error!(
"Failed to parse workspaces for {path_to_check:?} from package.json, got {unknown:?}. Skipping."
),
None => log::warn!(
"Skipping path {path_to_check:?} that has no prettier dependency and no workspaces section in its package.json"
),
}
}
}
@ -213,7 +217,9 @@ impl Prettier {
let workspace_ignore = path_to_check.join(".prettierignore");
if let Some(metadata) = fs.metadata(&workspace_ignore).await? {
if !metadata.is_dir {
log::info!("Found prettier ignore at workspace root {workspace_ignore:?}");
log::info!(
"Found prettier ignore at workspace root {workspace_ignore:?}"
);
return Ok(ControlFlow::Continue(Some(path_to_check)));
}
}
@ -646,7 +652,8 @@ mod tests {
&HashSet::default(),
Path::new("/root/work/project/src/index.js")
)
.await.unwrap(),
.await
.unwrap(),
ControlFlow::Continue(Some(PathBuf::from("/root/work/project"))),
"Should successfully find a prettier for path hierarchy that has node_modules with prettier, but no package.json mentions of it"
);