more lints
commit4ab5631d6521ffae6b31e9b9c72dd31a49e793ce
authorBlaž Hrastnik <blaz@mxxn.io>
dateThu 18 Feb 2021, 18:45 (6 years ago)
parent0827c45
helix-core/src/graphemes.rs+1−1
@@ -160,7 +160,7 @@ pub struct RopeGraphemes<'a> {
160160}
161161
162162impl<'a> RopeGraphemes<'a> {
163− pub fn new<'b>(slice: RopeSlice<'b>) -> RopeGraphemes<'b> {
163+ pub fn new(slice: RopeSlice) -> RopeGraphemes {
164164 let mut chunks = slice.chunks();
165165 let first_chunk = chunks.next().unwrap_or("");
166166 RopeGraphemes {
helix-core/src/lib.rs+1−4
@@ -13,15 +13,12 @@ pub mod syntax;
1313mod transaction;
1414
1515pub(crate) fn find_first_non_whitespace_char2(line: RopeSlice) -> Option<usize> {
16− let mut start = 0;
17−
1816 // find first non-whitespace char
19− for ch in line.chars() {
17+ for (start, ch) in line.chars().enumerate() {
2018 // TODO: could use memchr with chunks?
2119 if ch != ' ' && ch != '\t' && ch != '\n' {
2220 return Some(start);
2321 }
24− start += 1;
2522 }
2623
2724 None