aboutsummaryrefslogtreecommitdiff
path: root/helix-core/src/selection.rs
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-03-24 05:52:13 +0000
committerBlaž Hrastnik2021-03-24 05:58:01 +0000
commit06aca7691c845d129abc49fb649ea7c42376a077 (patch)
treed8eaf53aec0d323914d7839a36caa2a748885c3a /helix-core/src/selection.rs
parent8a0ab447ecfa6c2c448603d469ba4fd06e95c754 (diff)
clippy lint
Diffstat (limited to 'helix-core/src/selection.rs')
-rw-r--r--helix-core/src/selection.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/helix-core/src/selection.rs b/helix-core/src/selection.rs
index e16c2b6d..e76e12b4 100644
--- a/helix-core/src/selection.rs
+++ b/helix-core/src/selection.rs
@@ -99,14 +99,14 @@ impl Range {
#[must_use]
pub fn extend(&self, from: usize, to: usize) -> Self {
if from <= self.anchor && to >= self.anchor {
- return Range {
+ return Self {
anchor: from,
head: to,
horiz: None,
};
}
- Range {
+ Self {
anchor: self.anchor,
head: if abs_difference(from, self.anchor) > abs_difference(to, self.anchor) {
from
@@ -253,7 +253,7 @@ impl Selection {
// fast path for a single selection (cursor)
if ranges.len() == 1 {
- return Selection {
+ return Self {
ranges,
primary_index: 0,
};