Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/bootstrap/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,8 @@ pub fn format(build: &Builder<'_>, check: bool, paths: &[PathBuf]) {
let untracked_paths = untracked_paths_output
.lines()
.filter(|entry| entry.starts_with("??"))
.filter_map(|entry| {
let path =
entry.split(' ').nth(1).expect("every git status entry should list a path");
path.ends_with(".rs").then_some(path)
.map(|entry| {
entry.split(' ').nth(1).expect("every git status entry should list a path")
Comment on lines 147 to +149
Copy link
Member

@jyn514 jyn514 Apr 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can simplify this slightly:

                .filter_map(|entry| entry.strip_prefix("?? "))

(and remove .filter above)

});
for untracked_path in untracked_paths {
println!("skip untracked path {} during rustfmt invocations", untracked_path);
Expand Down