diff --git a/crates/egui/src/text_selection/text_cursor_state.rs b/crates/egui/src/text_selection/text_cursor_state.rs index efe55e6323b..1e691793394 100644 --- a/crates/egui/src/text_selection/text_cursor_state.rs +++ b/crates/egui/src/text_selection/text_cursor_state.rs @@ -312,7 +312,7 @@ pub fn create_char_line_indexes(text: &str) -> Vec { let mut line_indexes = vec![0]; let mut count = 0; - for (_i, c) in text.chars().enumerate() { + for c in text.chars() { count += 1; if c == '\n' { line_indexes.push(count);