mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +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
|
@ -386,7 +386,7 @@ pub unsafe fn trace_roots(tracer: *mut JSTracer) {
|
|||
STACK_ROOTS.with(|ref collection| {
|
||||
let RootCollectionPtr(collection) = collection.get().unwrap();
|
||||
let collection = &*(*collection).roots.get();
|
||||
for root in collection.iter() {
|
||||
for root in collection {
|
||||
trace_reflector(tracer, "reflector", &**root);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -429,7 +429,7 @@ impl RootedTraceableSet {
|
|||
}
|
||||
|
||||
unsafe fn trace(&self, tracer: *mut JSTracer) {
|
||||
for info in self.set.iter() {
|
||||
for info in &self.set {
|
||||
(info.trace)(info.ptr, tracer);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -235,7 +235,7 @@ pub fn do_create_interface_objects(cx: *mut JSContext,
|
|||
members, s.as_ptr())
|
||||
}
|
||||
|
||||
for ctor in named_constructors.iter() {
|
||||
for ctor in named_constructors {
|
||||
let (cnative, cname, cnargs) = *ctor;
|
||||
|
||||
let cs = CString::new(cname).unwrap();
|
||||
|
@ -321,7 +321,7 @@ fn create_interface_object(cx: *mut JSContext,
|
|||
/// Fails on JSAPI failure.
|
||||
fn define_constants(cx: *mut JSContext, obj: HandleObject,
|
||||
constants: &'static [ConstantSpec]) {
|
||||
for spec in constants.iter() {
|
||||
for spec in constants {
|
||||
let value = RootedValue::new(cx, spec.get_value());
|
||||
unsafe {
|
||||
assert!(JS_DefineProperty(cx, obj, spec.name.as_ptr() as *const libc::c_char,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue