aboutsummaryrefslogtreecommitdiff
path: root/helix-core/src/transaction.rs
diff options
context:
space:
mode:
authorBlaž Hrastnik2020-05-28 05:45:44 +0000
committerBlaž Hrastnik2020-05-28 05:45:44 +0000
commitb5c38812e923581a31eb5d38ddb96d44afd6505d (patch)
tree815aaf51e0ce1420d2a13d5961e663f4f2be29ac /helix-core/src/transaction.rs
parent23109f15129e3c3e89181164197c384861324b48 (diff)
address clippy warnings
Diffstat (limited to 'helix-core/src/transaction.rs')
-rw-r--r--helix-core/src/transaction.rs11
1 files changed, 4 insertions, 7 deletions
diff --git a/helix-core/src/transaction.rs b/helix-core/src/transaction.rs
index b9824bc2..60ccd7c6 100644
--- a/helix-core/src/transaction.rs
+++ b/helix-core/src/transaction.rs
@@ -14,10 +14,7 @@
// distance: usize,
// }
-use crate::{Buffer, Selection};
-
-use ropey::Rope;
-use tendril::StrTendril as Tendril;
+use crate::{Buffer, Rope, Selection, Tendril};
// TODO: divided into three different operations, I sort of like having just
// Splice { extent, Option<text>, distance } better.
@@ -56,6 +53,7 @@ pub struct ChangeSet {
}
impl ChangeSet {
+ #[must_use]
pub fn new(buf: &Buffer) -> Self {
let len = buf.contents.len_chars();
Self {
@@ -105,8 +103,7 @@ impl ChangeSet {
head_a = a;
head_b = changes_b.next();
}
- (None, _) => return Err(()),
- (_, None) => return Err(()),
+ (None, _) | (_, None) => return Err(()),
(Some(Retain(i)), Some(Retain(j))) => match i.cmp(&j) {
Ordering::Less => {
changes.push(Retain(i));
@@ -221,7 +218,7 @@ impl ChangeSet {
let mut pos = 0;
- for change in self.changes.iter() {
+ for change in &self.changes {
use Change::*;
match change {
Retain(n) => {