mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
For loops and misc changes
This commit is contained in:
parent
1bdaff0fad
commit
307f1074d3
42 changed files with 220 additions and 243 deletions
|
@ -252,7 +252,7 @@ impl<'self> Element {
|
|||
|
||||
pub fn get_attr(&'self self, name: &str) -> Option<&'self str> {
|
||||
// FIXME: Need an each() that links lifetimes in Rust.
|
||||
for self.attrs.iter().advance |attr| {
|
||||
for attr in self.attrs.iter() {
|
||||
if eq_slice(attr.name, name) {
|
||||
let val: &str = attr.value;
|
||||
return Some(val);
|
||||
|
@ -265,7 +265,7 @@ impl<'self> Element {
|
|||
let name = name.to_str();
|
||||
let value_cell = Cell::new(value.to_str());
|
||||
let mut found = false;
|
||||
for self.attrs.mut_iter().advance |attr| {
|
||||
for attr in self.attrs.mut_iter() {
|
||||
if eq_slice(attr.name, name) {
|
||||
attr.value = value_cell.take().clone();
|
||||
found = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue