summaryrefslogtreecommitdiff
path: root/helix-term/src/commands.rs
diff options
context:
space:
mode:
authorJason Rodney Hansen2021-11-28 17:58:52 +0000
committerIvan Tham2021-12-05 08:22:58 +0000
commitc74cd48f38863b3004eaf2b52336ed0597337044 (patch)
tree9440f98001113f82ba065627e7ce29c14d528404 /helix-term/src/commands.rs
parentfebee2dc0c20cab360f75c2088c8f59b13a12e95 (diff)
Cleanup
Diffstat (limited to 'helix-term/src/commands.rs')
-rw-r--r--helix-term/src/commands.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 4869a135..c89c81db 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -5803,17 +5803,17 @@ fn increment_impl(cx: &mut Context, amount: i64) {
let text = doc.text();
let changes = selection.ranges().iter().filter_map(|range| {
- let incrementor: Option<Box<dyn Increment>> = if let Some(incrementor) =
+ let incrementor: Box<dyn Increment> = if let Some(incrementor) =
DateTimeIncrementor::from_range(text.slice(..), *range)
{
- Some(Box::new(incrementor))
+ Box::new(incrementor)
} else if let Some(incrementor) = NumberIncrementor::from_range(text.slice(..), *range) {
- Some(Box::new(incrementor))
+ Box::new(incrementor)
} else {
- None
+ return None;
};
- let (range, new_text) = incrementor?.increment(amount);
+ let (range, new_text) = incrementor.increment(amount);
Some((range.from(), range.to(), Some(new_text)))
});