summaryrefslogtreecommitdiff
path: root/src/syntax
diff options
context:
space:
mode:
Diffstat (limited to 'src/syntax')
-rw-r--r--src/syntax/lexer.rs6
-rw-r--r--src/syntax/reparser.rs4
-rw-r--r--src/syntax/source.rs2
3 files changed, 5 insertions, 7 deletions
diff --git a/src/syntax/lexer.rs b/src/syntax/lexer.rs
index 43a4872b..a5e4a9e0 100644
--- a/src/syntax/lexer.rs
+++ b/src/syntax/lexer.rs
@@ -284,10 +284,8 @@ impl Lexer<'_> {
self.s.eat_while(char::is_ascii_digit);
let read = self.s.from(start);
- if self.s.eat_if('.') && self.space_or_end() {
- if read.parse::<usize>().is_ok() {
- return SyntaxKind::EnumMarker;
- }
+ if self.s.eat_if('.') && self.space_or_end() && read.parse::<usize>().is_ok() {
+ return SyntaxKind::EnumMarker;
}
self.text()
diff --git a/src/syntax/reparser.rs b/src/syntax/reparser.rs
index 75a5cc27..18960941 100644
--- a/src/syntax/reparser.rs
+++ b/src/syntax/reparser.rs
@@ -72,7 +72,7 @@ fn try_reparse(
return node
.replace_children(i..i + 1, vec![newborn])
.is_ok()
- .then(|| new_range);
+ .then_some(new_range);
}
}
}
@@ -157,7 +157,7 @@ fn try_reparse(
return node
.replace_children(start..end, newborns)
.is_ok()
- .then(|| new_range);
+ .then_some(new_range);
}
}
}
diff --git a/src/syntax/source.rs b/src/syntax/source.rs
index e8553b1e..233fb367 100644
--- a/src/syntax/source.rs
+++ b/src/syntax/source.rs
@@ -212,7 +212,7 @@ impl Source {
k += c.len_utf16();
}
- (k == utf16_idx).then(|| self.text.len())
+ (k == utf16_idx).then_some(self.text.len())
}
/// Return the byte position at which the given line starts.