diff --git a/src/types/array.rs b/src/types/array.rs index c54173e14..28bf47a89 100644 --- a/src/types/array.rs +++ b/src/types/array.rs @@ -7,7 +7,6 @@ use std::{ ffi::CString, fmt::Debug, iter::FromIterator, - ptr::NonNull, u64, }; @@ -16,8 +15,8 @@ use crate::{ convert::{FromZval, IntoZval}, error::{Error, Result}, ffi::{ - _Bucket, _zend_new_array, zend_array_count, zend_array_destroy, zend_array_dup, - zend_hash_clean, zend_hash_get_current_data_ex, zend_hash_get_current_key_type_ex, + _zend_new_array, zend_array_count, zend_array_destroy, zend_array_dup, zend_hash_clean, + zend_hash_get_current_data_ex, zend_hash_get_current_key_type_ex, zend_hash_get_current_key_zval_ex, zend_hash_index_del, zend_hash_index_find, zend_hash_index_update, zend_hash_move_backwards_ex, zend_hash_move_forward_ex, zend_hash_next_index_insert, zend_hash_str_del, zend_hash_str_find, zend_hash_str_update, @@ -119,8 +118,7 @@ impl ZendHashTable { /// assert_eq!(ht.len(), 2); /// ``` pub fn len(&self) -> usize { - return unsafe { zend_array_count(self as *const ZendHashTable as *mut ZendHashTable) } - as usize; + unsafe { zend_array_count(self as *const ZendHashTable as *mut ZendHashTable) as usize } } /// Returns whether the hash table is empty. @@ -534,11 +532,11 @@ impl<'a> Iter<'a> { /// /// * `ht` - The hashtable to iterate. pub fn new(ht: &'a ZendHashTable) -> Self { - return Self { + Self { ht, current_num: 0, pos: 0, - }; + } } } @@ -582,9 +580,9 @@ impl<'a> Iterator for Iter<'a> { &mut self.pos as *mut HashPosition, ) }; - self.current_num = self.current_num + 1; + self.current_num += 1; - return Some(r); + Some(r) } fn count(self) -> usize @@ -639,9 +637,9 @@ impl<'a> DoubleEndedIterator for Iter<'a> { &mut self.pos as *mut HashPosition, ) }; - self.current_num = self.current_num - 1; + self.current_num -= 1; - return Some(r); + Some(r) } }