more clippy::complexity fixes

This commit is contained in:
Matthias Krüger
2022-12-15 00:06:34 +01:00
parent fbf8b937b4
commit de59844c98
13 changed files with 23 additions and 41 deletions

View File

@@ -941,7 +941,7 @@ impl SourceMap {
/// Otherwise, the span reached to limit is returned.
pub fn span_look_ahead(&self, span: Span, expect: Option<&str>, limit: Option<usize>) -> Span {
let mut sp = span;
for _ in 0..limit.unwrap_or(100 as usize) {
for _ in 0..limit.unwrap_or(100_usize) {
sp = self.next_point(sp);
if let Ok(ref snippet) = self.span_to_snippet(sp) {
if expect.map_or(false, |es| snippet == es) {