clippy: Fix needless borrow warnings (#31813)

This commit is contained in:
Oluwatobi Sofela 2024-03-21 18:48:54 +01:00 committed by GitHub
parent 694e86ecff
commit 3e63f8d6ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
42 changed files with 151 additions and 157 deletions

View file

@ -133,7 +133,7 @@ impl DOMTokenListMethods for DOMTokenList {
fn Add(&self, tokens: Vec<DOMString>) -> ErrorResult {
let mut atoms = self.element.get_tokenlist_attribute(&self.local_name);
for token in &tokens {
let token = self.check_token_exceptions(&token)?;
let token = self.check_token_exceptions(token)?;
if !atoms.iter().any(|atom| *atom == token) {
atoms.push(token);
}
@ -146,7 +146,7 @@ impl DOMTokenListMethods for DOMTokenList {
fn Remove(&self, tokens: Vec<DOMString>) -> ErrorResult {
let mut atoms = self.element.get_tokenlist_attribute(&self.local_name);
for token in &tokens {
let token = self.check_token_exceptions(&token)?;
let token = self.check_token_exceptions(token)?;
atoms
.iter()
.position(|atom| *atom == token)