Fix clippy::println_empty_string, clippy::while_let_on_iterator, clippy::while_let_on_iterator lint style violations (#36613)

Related: #36577

Release Notes:

- N/A
This commit is contained in:
Umesh Yadav 2025-08-20 23:44:30 +05:30 committed by GitHub
parent 41e28a7185
commit ec8106d1db
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 35 additions and 32 deletions

View file

@ -3183,9 +3183,9 @@ mod tests {
// so we special case row 0 to assume a leading '\n'.
//
// Linehood is the birthright of strings.
let mut input_text_lines = input_text.split('\n').enumerate().peekable();
let input_text_lines = input_text.split('\n').enumerate().peekable();
let mut block_row = 0;
while let Some((wrap_row, input_line)) = input_text_lines.next() {
for (wrap_row, input_line) in input_text_lines {
let wrap_row = wrap_row as u32;
let multibuffer_row = wraps_snapshot
.to_point(WrapPoint::new(wrap_row, 0), Bias::Left)

View file

@ -11021,7 +11021,7 @@ impl Editor {
let mut col = 0;
let mut changed = false;
while let Some(ch) = chars.next() {
for ch in chars.by_ref() {
match ch {
' ' => {
reindented_line.push(' ');
@ -11077,7 +11077,7 @@ impl Editor {
let mut first_non_indent_char = None;
let mut changed = false;
while let Some(ch) = chars.next() {
for ch in chars.by_ref() {
match ch {
' ' => {
// Keep track of spaces. Append \t when we reach tab_size

View file

@ -164,8 +164,8 @@ pub fn indent_guides_in_range(
let end_anchor = snapshot.buffer_snapshot.anchor_after(end_offset);
let mut fold_ranges = Vec::<Range<Point>>::new();
let mut folds = snapshot.folds_in_range(start_offset..end_offset).peekable();
while let Some(fold) = folds.next() {
let folds = snapshot.folds_in_range(start_offset..end_offset).peekable();
for fold in folds {
let start = fold.range.start.to_point(&snapshot.buffer_snapshot);
let end = fold.range.end.to_point(&snapshot.buffer_snapshot);
if let Some(last_range) = fold_ranges.last_mut()

View file

@ -103,9 +103,9 @@ impl FollowableItem for Editor {
multibuffer = MultiBuffer::new(project.read(cx).capability());
let mut sorted_excerpts = state.excerpts.clone();
sorted_excerpts.sort_by_key(|e| e.id);
let mut sorted_excerpts = sorted_excerpts.into_iter().peekable();
let sorted_excerpts = sorted_excerpts.into_iter().peekable();
while let Some(excerpt) = sorted_excerpts.next() {
for excerpt in sorted_excerpts {
let Ok(buffer_id) = BufferId::new(excerpt.buffer_id) else {
continue;
};