Merge pull request #1060 from JasonLG1979/fix-clippy-lint

Fix clippy lint
This commit is contained in:
Roderick van Domburg 2022-09-23 07:52:52 +02:00 committed by GitHub
commit cce1b966cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -54,12 +54,7 @@ struct TokenData {
impl TokenProvider { impl TokenProvider {
fn find_token(&self, scopes: Vec<&str>) -> Option<usize> { fn find_token(&self, scopes: Vec<&str>) -> Option<usize> {
self.lock(|inner| { self.lock(|inner| {
for i in 0..inner.tokens.len() { (0..inner.tokens.len()).find(|&i| inner.tokens[i].in_scopes(scopes.clone()))
if inner.tokens[i].in_scopes(scopes.clone()) {
return Some(i);
}
}
None
}) })
} }