mirror of
https://github.com/servo/servo.git
synced 2025-09-30 16:49:16 +01:00
Replace uses of for foo in bar.iter()
,
and `for foo in bar.iter_mut(), and for foo in bar.into_iter() (continuation of #7197)
This commit is contained in:
parent
f4b526cfb4
commit
067a22a868
32 changed files with 76 additions and 78 deletions
|
@ -227,7 +227,7 @@ pub fn get_null_window_handle() -> cef_window_handle_t {
|
|||
|
||||
pub fn update() {
|
||||
BROWSERS.with(|browsers| {
|
||||
for browser in browsers.borrow().iter() {
|
||||
for browser in &browsers.borrow() {
|
||||
if browser.downcast().callback_executed.get() == false {
|
||||
browser_callback_after_created(browser.clone());
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ pub extern "C" fn command_line_get_switch_value(cmd: *mut cef_command_line_t, na
|
|||
let slice = slice::from_raw_parts(buf, (*cs).length as usize);
|
||||
let opt = String::from_utf16(slice).unwrap();
|
||||
//debug!("opt: {}", opt);
|
||||
for s in (*cl).argv.iter() {
|
||||
for s in &(*cl).argv {
|
||||
let o = s.trim_left_matches('-');
|
||||
//debug!("arg: {}", o);
|
||||
if o.starts_with(&opt) {
|
||||
|
@ -104,4 +104,3 @@ cef_stub_static_method_impls! {
|
|||
fn cef_command_line_create_command_line() -> *mut cef_command_line_t
|
||||
fn cef_command_line_get_global_command_line() -> *mut cef_command_line_t
|
||||
}
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ pub extern "C" fn cef_string_multimap_key(smm: *mut cef_string_multimap_t, index
|
|||
if index < 0 || smm.is_null() { return 0; }
|
||||
let mut rem = index as usize;
|
||||
|
||||
for (key, val) in (*smm).iter() {
|
||||
for (key, val) in &(*smm) {
|
||||
if rem < (*val).len() {
|
||||
return cef_string_utf16_set((*key).as_bytes().as_ptr() as *const u16,
|
||||
(*key).len() as u64,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue