diff --git a/src/dc_array.rs b/src/dc_array.rs index 93e5dbe7f..3991e3fd1 100644 --- a/src/dc_array.rs +++ b/src/dc_array.rs @@ -233,8 +233,8 @@ pub unsafe fn dc_array_search_id( if array.is_null() { return false; } - for i in 0..(*array).array.len() { - if (*array).array[i] == needle as size_t { + for (i, &u) in (*array).array.iter().enumerate() { + if u == needle as size_t { if !ret_index.is_null() { *ret_index = i }