mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 08:44:35 +00:00
skip formatting if no files have been modified
Signed-off-by: onur-ozkan <work@onurozkan.dev>
This commit is contained in:
parent
35ce85e0fd
commit
0a7f9e2134
@ -200,6 +200,11 @@ pub fn format(build: &Builder<'_>, check: bool, all: bool, paths: &[PathBuf]) {
|
||||
adjective = Some("modified");
|
||||
match get_modified_rs_files(build) {
|
||||
Ok(Some(files)) => {
|
||||
if files.is_empty() {
|
||||
println!("fmt info: No modified files detected for formatting.");
|
||||
return;
|
||||
}
|
||||
|
||||
for file in files {
|
||||
override_builder.add(&format!("/{file}")).expect(&file);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user