Stop using position_elem.

It is unstable and not really better than the stable alternative.
This commit is contained in:
Ms2ger 2015-06-27 18:23:05 +02:00
parent 8892f8175d
commit c9f50f41b5
2 changed files with 2 additions and 4 deletions

View file

@ -310,7 +310,7 @@ impl<'a> EventTargetMethods for &'a EventTarget {
phase: phase, phase: phase,
listener: EventListenerType::Additive(listener) listener: EventListenerType::Additive(listener)
}; };
if entry.position_elem(&new_entry).is_none() { if !entry.contains(&new_entry) {
entry.push(new_entry); entry.push(new_entry);
} }
}, },
@ -332,8 +332,7 @@ impl<'a> EventTargetMethods for &'a EventTarget {
phase: phase, phase: phase,
listener: EventListenerType::Additive(listener.clone()) listener: EventListenerType::Additive(listener.clone())
}; };
let position = entry.position_elem(&old_entry); if let Some(position) = entry.iter().position(|e| *e == old_entry) {
for &position in position.iter() {
entry.remove(position); entry.remove(position);
} }
} }

View file

@ -19,7 +19,6 @@
#![feature(plugin)] #![feature(plugin)]
#![feature(rc_unique)] #![feature(rc_unique)]
#![feature(slice_chars)] #![feature(slice_chars)]
#![feature(slice_position_elem)]
#![feature(str_utf16)] #![feature(str_utf16)]
#![feature(vec_push_all)] #![feature(vec_push_all)]