Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed Mar 7, 2023
1 parent 3b1161b commit 673011f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
8 changes: 4 additions & 4 deletions crates/rome_service/src/file_handlers/javascript.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ fn fix_all(params: FixAllParams) -> Result<FixFileResult, WorkspaceError> {
};

let mut skipped_suggested_fixes = 0;
let mut errors = 0;
let mut errors: u16 = 0;
let analyzer_options = compute_analyzer_options(&settings);
loop {
let (action, _) = analyze(&tree, filter, &analyzer_options, |signal| {
Expand All @@ -416,7 +416,7 @@ fn fix_all(params: FixAllParams) -> Result<FixFileResult, WorkspaceError> {
skipped_suggested_fixes += 1;
}
if action.applicability == Applicability::Always {
errors -= 1;
errors = errors.saturating_sub(1);
return ControlFlow::Break(action);
}
}
Expand All @@ -425,7 +425,7 @@ fn fix_all(params: FixAllParams) -> Result<FixFileResult, WorkspaceError> {
action.applicability,
Applicability::Always | Applicability::MaybeIncorrect
) {
errors -= 1;
errors = errors.saturating_sub(1);
return ControlFlow::Break(action);
}
}
Expand Down Expand Up @@ -463,7 +463,7 @@ fn fix_all(params: FixAllParams) -> Result<FixFileResult, WorkspaceError> {
code: tree.syntax().to_string(),
skipped_suggested_fixes,
actions,
errors,
errors: errors.into(),
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/rome_service/src/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ pub struct FixFileResult {
/// List of all the code actions applied to the file
pub actions: Vec<FixAction>,

/// List of errors
/// Number of errors
pub errors: usize,

/// number of skipped suggested fixes
Expand Down
4 changes: 4 additions & 0 deletions npm/backend-jsonrpc/src/workspace.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 673011f

Please sign in to comment.