more clippy fixes

This commit is contained in:
Greg Shuflin
2026-03-17 03:58:01 -07:00
parent dbd89be1d7
commit ce8fd8bd95
3 changed files with 34 additions and 54 deletions
+32 -52
View File
@@ -468,17 +468,12 @@ impl Configuration {
// Walk backward through chars of the same class to find the word start
let end_class = char_class(buffer.char_at(x, y).unwrap_or(' '));
loop {
match prev_pos(x, y, buffer) {
Some((nx, ny)) => {
if buffer.char_at(nx, ny).map(char_class) == Some(end_class) {
x = nx;
y = ny;
} else {
break;
}
}
None => break,
while let Some((nx, ny)) = prev_pos(x, y, buffer) {
if buffer.char_at(nx, ny).map(char_class) == Some(end_class) {
x = nx;
y = ny;
} else {
break;
}
}
@@ -508,21 +503,16 @@ impl Configuration {
}
// Walk backward through non-whitespace to find the WORD start
loop {
match prev_pos(x, y, buffer) {
Some((nx, ny)) => {
if buffer
.char_at(nx, ny)
.map(|c| !c.is_whitespace())
.unwrap_or(false)
{
x = nx;
y = ny;
} else {
break;
}
}
None => break,
while let Some((nx, ny)) = prev_pos(x, y, buffer) {
if buffer
.char_at(nx, ny)
.map(|c| !c.is_whitespace())
.unwrap_or(false)
{
x = nx;
y = ny;
} else {
break;
}
}
@@ -554,17 +544,12 @@ impl Configuration {
// Advance while the next position has the same class
let cur_class = char_class(buffer.char_at(x, y).unwrap_or(' '));
loop {
match next_pos(x, y, buffer) {
Some((nx, ny)) => {
if buffer.char_at(nx, ny).map(char_class) == Some(cur_class) {
x = nx;
y = ny;
} else {
break;
}
}
None => break,
while let Some((nx, ny)) = next_pos(x, y, buffer) {
if buffer.char_at(nx, ny).map(char_class) == Some(cur_class) {
x = nx;
y = ny;
} else {
break;
}
}
@@ -595,21 +580,16 @@ impl Configuration {
}
// Advance while the next position is also non-whitespace
loop {
match next_pos(x, y, buffer) {
Some((nx, ny)) => {
if buffer
.char_at(nx, ny)
.map(|c| !c.is_whitespace())
.unwrap_or(false)
{
x = nx;
y = ny;
} else {
break;
}
}
None => break,
while let Some((nx, ny)) = next_pos(x, y, buffer) {
if buffer
.char_at(nx, ny)
.map(|c| !c.is_whitespace())
.unwrap_or(false)
{
x = nx;
y = ny;
} else {
break;
}
}
+1 -1
View File
@@ -38,7 +38,7 @@ impl Display for BasicErrorKind {
}
impl BasicErrorKind {
#[allow(dead_code)]
#[allow(dead_code, clippy::wrong_self_convention)]
pub fn to_error(self) -> BasicError {
BasicError { kind: self }
}
+1 -1
View File
@@ -116,7 +116,7 @@ impl TerminalUI {
if needs_render {
self.terminal
.draw(|mut frame| self.terminal_state.render(frame, &mut self.editor_core))?;
.draw(|frame| self.terminal_state.render(frame, &mut self.editor_core))?;
let cursor_shape = match self.editor_core.active_mode() {
Mode::Insert => SetCursorStyle::SteadyBar,