Enable clippy::explicit_counter_loop
(#8776)
This PR enables the [`clippy::explicit_counter_loop`](https://rust-lang.github.io/rust-clippy/master/index.html#/explicit_counter_loop) rule and fixes the outstanding violations. Release Notes: - N/A
This commit is contained in:
parent
08f9c3f568
commit
1fa9496334
2 changed files with 2 additions and 5 deletions
|
@ -2735,9 +2735,8 @@ impl Editor {
|
||||||
|
|
||||||
let mut edits = Vec::new();
|
let mut edits = Vec::new();
|
||||||
let mut rows = Vec::new();
|
let mut rows = Vec::new();
|
||||||
let mut rows_inserted = 0;
|
|
||||||
|
|
||||||
for selection in self.selections.all_adjusted(cx) {
|
for (rows_inserted, selection) in self.selections.all_adjusted(cx).into_iter().enumerate() {
|
||||||
let cursor = selection.head();
|
let cursor = selection.head();
|
||||||
let row = cursor.row;
|
let row = cursor.row;
|
||||||
|
|
||||||
|
@ -2746,8 +2745,7 @@ impl Editor {
|
||||||
let newline = "\n".to_string();
|
let newline = "\n".to_string();
|
||||||
edits.push((start_of_line..start_of_line, newline));
|
edits.push((start_of_line..start_of_line, newline));
|
||||||
|
|
||||||
rows.push(row + rows_inserted);
|
rows.push(row + rows_inserted as u32);
|
||||||
rows_inserted += 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
self.transact(cx, |editor, cx| {
|
self.transact(cx, |editor, cx| {
|
||||||
|
|
|
@ -89,7 +89,6 @@ fn run_clippy(args: ClippyArgs) -> Result<()> {
|
||||||
"clippy::derivable_impls",
|
"clippy::derivable_impls",
|
||||||
"clippy::derive_ord_xor_partial_ord",
|
"clippy::derive_ord_xor_partial_ord",
|
||||||
"clippy::eq_op",
|
"clippy::eq_op",
|
||||||
"clippy::explicit_counter_loop",
|
|
||||||
"clippy::implied_bounds_in_impls",
|
"clippy::implied_bounds_in_impls",
|
||||||
"clippy::iter_kv_map",
|
"clippy::iter_kv_map",
|
||||||
"clippy::iter_overeager_cloned",
|
"clippy::iter_overeager_cloned",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue