Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/types/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -678,13 +678,13 @@ impl<'a> Iterator for Iter<'a> {
}
}

impl<'a> ExactSizeIterator for Iter<'a> {
impl ExactSizeIterator for Iter<'_> {
fn len(&self) -> usize {
self.ht.len()
}
}

impl<'a> DoubleEndedIterator for Iter<'a> {
impl DoubleEndedIterator for Iter<'_> {
fn next_back(&mut self) -> Option<Self::Item> {
let key_type = unsafe {
zend_hash_get_current_key_type_ex(
Expand Down Expand Up @@ -730,8 +730,8 @@ impl<'a> DoubleEndedIterator for Iter<'a> {
}
}

impl<'a, 'b> Iter<'a> {
pub fn next_zval(&'b mut self) -> Option<(Zval, &'a Zval)> {
impl<'a> Iter<'a> {
pub fn next_zval(&mut self) -> Option<(Zval, &'a Zval)> {
let key_type = unsafe {
zend_hash_get_current_key_type_ex(
self.ht as *const ZendHashTable as *mut ZendHashTable,
Expand Down Expand Up @@ -805,13 +805,13 @@ impl<'a> Iterator for Values<'a> {
}
}

impl<'a> ExactSizeIterator for Values<'a> {
impl ExactSizeIterator for Values<'_> {
fn len(&self) -> usize {
self.0.len()
}
}

impl<'a> DoubleEndedIterator for Values<'a> {
impl DoubleEndedIterator for Values<'_> {
fn next_back(&mut self) -> Option<Self::Item> {
self.0.next_back().map(|(_, zval)| zval)
}
Expand Down Expand Up @@ -847,7 +847,7 @@ impl<'a> FromZval<'a> for &'a ZendHashTable {
}

///////////////////////////////////////////
/// HashMap
// HashMap
///////////////////////////////////////////

impl<'a, V> TryFrom<&'a ZendHashTable> for HashMap<String, V>
Expand Down Expand Up @@ -916,7 +916,7 @@ where
}

///////////////////////////////////////////
/// Vec
// Vec
///////////////////////////////////////////

impl<'a, T> TryFrom<&'a ZendHashTable> for Vec<T>
Expand Down
6 changes: 3 additions & 3 deletions src/types/callable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ impl<'a> FromZval<'a> for ZendCallable<'a> {
}
}

impl<'a> TryFrom<Zval> for ZendCallable<'a> {
impl TryFrom<Zval> for ZendCallable<'_> {
type Error = Error;

fn try_from(value: Zval) -> Result<Self> {
Expand All @@ -158,7 +158,7 @@ enum OwnedZval<'a> {
Owned(Zval),
}

impl<'a> OwnedZval<'a> {
impl OwnedZval<'_> {
fn as_ref(&self) -> &Zval {
match self {
OwnedZval::Reference(zv) => zv,
Expand All @@ -167,7 +167,7 @@ impl<'a> OwnedZval<'a> {
}
}

impl<'a> Deref for OwnedZval<'a> {
impl Deref for OwnedZval<'_> {
type Target = Zval;

fn deref(&self) -> &Self::Target {
Expand Down
2 changes: 1 addition & 1 deletion src/types/iterable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub enum Iterable<'a> {
Traversable(&'a mut ZendIterator),
}

impl<'a> Iterable<'a> {
impl Iterable<'_> {
/// Creates a new rust iterator from a PHP iterable.
/// May return None if a Traversable cannot be rewound.
pub fn iter(&mut self) -> Option<Iter> {
Expand Down
2 changes: 1 addition & 1 deletion src/types/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ impl IntoZval for ZBox<ZendObject> {
}
}

impl<'a> IntoZval for &'a mut ZendObject {
impl IntoZval for &mut ZendObject {
const TYPE: DataType = DataType::Object(None);

#[inline]
Expand Down
2 changes: 1 addition & 1 deletion src/types/zval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl Zval {

/// Dereference the zval, if it is a reference.
pub fn dereference(&self) -> &Self {
return self.reference().or_else(|| self.indirect()).unwrap_or(self);
self.reference().or_else(|| self.indirect()).unwrap_or(self)
}

/// Dereference the zval mutable, if it is a reference.
Expand Down