mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Replace uses of for foo in bar.iter()
and for foo in bar.iter_mut()
closes #7197
This commit is contained in:
parent
13e7de482c
commit
0038580abf
55 changed files with 141 additions and 154 deletions
|
@ -101,7 +101,7 @@ impl<'a> DOMTokenListMethods for &'a DOMTokenList {
|
|||
fn Add(self, tokens: Vec<DOMString>) -> ErrorResult {
|
||||
let element = self.element.root();
|
||||
let mut atoms = element.r().get_tokenlist_attribute(&self.local_name);
|
||||
for token in tokens.iter() {
|
||||
for token in &tokens {
|
||||
let token = try!(self.check_token_exceptions(&token));
|
||||
if !atoms.iter().any(|atom| *atom == token) {
|
||||
atoms.push(token);
|
||||
|
@ -115,7 +115,7 @@ impl<'a> DOMTokenListMethods for &'a DOMTokenList {
|
|||
fn Remove(self, tokens: Vec<DOMString>) -> ErrorResult {
|
||||
let element = self.element.root();
|
||||
let mut atoms = element.r().get_tokenlist_attribute(&self.local_name);
|
||||
for token in tokens.iter() {
|
||||
for token in &tokens {
|
||||
let token = try!(self.check_token_exceptions(&token));
|
||||
atoms.iter().position(|atom| *atom == token).map(|index| {
|
||||
atoms.remove(index)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue