Skip to content

Commit 1125576

Browse files
committed
Change the return type of check_diff to u8
`i32` didn't seem like the right return type to me. Since we're just recording that any error happened `u8` seemed good enough for that.
1 parent 837c4ee commit 1125576

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

check_diff/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -551,8 +551,8 @@ pub fn check_diff<T: AsRef<str>, P: AsRef<Path>>(
551551
runners: &CheckDiffRunners<impl CodeFormatter, impl CodeFormatter>,
552552
repo: P,
553553
repo_url: &str,
554-
) -> i32 {
555-
let mut errors = 0;
554+
) -> u8 {
555+
let mut errors: u8 = 0;
556556
let repo = repo.as_ref();
557557
let iter = search_for_rs_files(repo);
558558
for file in iter {
@@ -574,7 +574,7 @@ pub fn check_diff<T: AsRef<str>, P: AsRef<Path>>(
574574
relative_path.display(),
575575
diff,
576576
);
577-
errors += 1;
577+
errors = errors.saturating_add(1);
578578
} else {
579579
trace!(
580580
"No diff found in '{0}' when formatting {0}/{1}",

0 commit comments

Comments
 (0)