Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
conradludgate committed Jul 3, 2022
1 parent 1b24d4b commit 357d33e
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/command/client/search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -713,10 +713,6 @@ impl Cursor {
&self.source[..self.index]
}

pub fn index(&self) -> usize {
self.index
}

/// Returns the currently selected [`char`]
pub fn char(&self) -> Option<char> {
self.source[self.index..].chars().next()
Expand Down Expand Up @@ -787,7 +783,7 @@ mod cursor_tests {
let mut c = Cursor::from(String::from("öaöböcödöeöfö"));
let indices = [0, 2, 3, 5, 6, 8, 9, 11, 12, 14, 15, 17, 18, 20, 20, 20, 20];
for i in indices {
assert_eq!(c.index(), i);
assert_eq!(c.index, i);
c.right();
}
}
Expand All @@ -799,7 +795,7 @@ mod cursor_tests {
c.end();
let indices = [20, 18, 17, 15, 14, 12, 11, 9, 8, 6, 5, 3, 2, 0, 0, 0, 0];
for i in indices {
assert_eq!(c.index(), i);
assert_eq!(c.index, i);
c.left();
}
}
Expand All @@ -825,7 +821,7 @@ mod cursor_tests {
let mut c = Cursor::from(String::from("öaöböcödöeöfö"));
// move to ^
for _ in 0..4 {
c.right()
c.right();
}
assert_eq!(c.substring(), "öaöb");
assert_eq!(c.back(), Some('b'));
Expand All @@ -841,7 +837,7 @@ mod cursor_tests {
let mut c = Cursor::from(String::from("öaöböcödöeöfö"));
// move to ^
for _ in 0..4 {
c.right()
c.right();
}
assert_eq!(c.substring(), "öaöb");
c.insert('ö');
Expand Down

0 comments on commit 357d33e

Please sign in to comment.