aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-02-18 09:45:41 +0000
committerBlaž Hrastnik2021-02-18 09:45:41 +0000
commit4ab5631d6521ffae6b31e9b9c72dd31a49e793ce (patch)
treefbfd16a36801bdbd8ae642326033e95aa9fc0ec1
parent0827c45d9421ae946f35f994446829e37f73b711 (diff)
more lints
-rw-r--r--helix-core/src/graphemes.rs2
-rw-r--r--helix-core/src/lib.rs5
2 files changed, 2 insertions, 5 deletions
diff --git a/helix-core/src/graphemes.rs b/helix-core/src/graphemes.rs
index e0693769..7e5424be 100644
--- a/helix-core/src/graphemes.rs
+++ b/helix-core/src/graphemes.rs
@@ -160,7 +160,7 @@ pub struct RopeGraphemes<'a> {
}
impl<'a> RopeGraphemes<'a> {
- pub fn new<'b>(slice: RopeSlice<'b>) -> RopeGraphemes<'b> {
+ pub fn new(slice: RopeSlice) -> RopeGraphemes {
let mut chunks = slice.chunks();
let first_chunk = chunks.next().unwrap_or("");
RopeGraphemes {
diff --git a/helix-core/src/lib.rs b/helix-core/src/lib.rs
index 977129ef..14e58293 100644
--- a/helix-core/src/lib.rs
+++ b/helix-core/src/lib.rs
@@ -13,15 +13,12 @@ pub mod syntax;
mod transaction;
pub(crate) fn find_first_non_whitespace_char2(line: RopeSlice) -> Option<usize> {
- let mut start = 0;
-
// find first non-whitespace char
- for ch in line.chars() {
+ for (start, ch) in line.chars().enumerate() {
// TODO: could use memchr with chunks?
if ch != ' ' && ch != '\t' && ch != '\n' {
return Some(start);
}
- start += 1;
}
None