From d446258be5804affb81892cc48480299ecf807c6 Mon Sep 17 00:00:00 2001 From: JasonLG1979 Date: Thu, 22 Sep 2022 16:41:03 -0500 Subject: [PATCH] Fix clippy lint --- core/src/token.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/core/src/token.rs b/core/src/token.rs index bea37074..946367c3 100644 --- a/core/src/token.rs +++ b/core/src/token.rs @@ -54,12 +54,7 @@ struct TokenData { impl TokenProvider { fn find_token(&self, scopes: Vec<&str>) -> Option { self.lock(|inner| { - for i in 0..inner.tokens.len() { - if inner.tokens[i].in_scopes(scopes.clone()) { - return Some(i); - } - } - None + (0..inner.tokens.len()).find(|&i| inner.tokens[i].in_scopes(scopes.clone())) }) }