Skip to content

Commit

Permalink
fix(clippy): tackle clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
dinocosta committed Feb 21, 2025
1 parent 660f43c commit 4dd4dd1
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions crates/vim/src/normal/mark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ impl Vim {
}
} else {
// Save the last anchor so as to jump to it later.
let anchor: Option<Anchor> = anchors.last_mut().map(|last| last.clone());
let anchor: Option<Anchor> = anchors.last_mut().map(|anchor| *anchor);
let should_jump = self.mode == Mode::Visual
|| self.mode == Mode::VisualLine
|| self.mode == Mode::VisualBlock;
Expand Down Expand Up @@ -151,15 +151,10 @@ impl Vim {
}
});

if should_jump && anchor.is_some() {
self.motion(
Motion::Jump {
anchor: anchor.unwrap(),
line,
},
window,
cx,
)
if should_jump {
if let Some(anchor) = anchor {
self.motion(Motion::Jump { anchor, line }, window, cx)
}
}
}
}
Expand Down

0 comments on commit 4dd4dd1

Please sign in to comment.