Skip to content

Commit 16c456d

Browse files
committed
'Fixed' lifetimes for array conversions
Not 100% sure why we were using higher-ranked trait bounds for this. It doesn't really make sense to me all these months later.
1 parent a776d3e commit 16c456d

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/types/array.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -670,13 +670,13 @@ impl<'a> FromZval<'a> for &'a ZendHashTable {
670670
//// HashMap
671671
///////////////////////////////////////////
672672

673-
impl<V> TryFrom<&ZendHashTable> for HashMap<String, V>
673+
impl<'a, V> TryFrom<&'a ZendHashTable> for HashMap<String, V>
674674
where
675-
for<'a> V: FromZval<'a>,
675+
V: FromZval<'a>,
676676
{
677677
type Error = Error;
678678

679-
fn try_from(value: &ZendHashTable) -> Result<Self> {
679+
fn try_from(value: &'a ZendHashTable) -> Result<Self> {
680680
let mut hm = HashMap::with_capacity(value.len());
681681

682682
for (idx, key, val) in value.iter() {
@@ -724,13 +724,13 @@ where
724724
}
725725
}
726726

727-
impl<T> FromZval<'_> for HashMap<String, T>
727+
impl<'a, T> FromZval<'a> for HashMap<String, T>
728728
where
729-
for<'a> T: FromZval<'a>,
729+
T: FromZval<'a>,
730730
{
731731
const TYPE: DataType = DataType::Array;
732732

733-
fn from_zval(zval: &Zval) -> Option<Self> {
733+
fn from_zval(zval: &'a Zval) -> Option<Self> {
734734
zval.array().and_then(|arr| arr.try_into().ok())
735735
}
736736
}
@@ -739,13 +739,13 @@ where
739739
//// Vec
740740
///////////////////////////////////////////
741741

742-
impl<T> TryFrom<&ZendHashTable> for Vec<T>
742+
impl<'a, T> TryFrom<&'a ZendHashTable> for Vec<T>
743743
where
744-
for<'a> T: FromZval<'a>,
744+
T: FromZval<'a>,
745745
{
746746
type Error = Error;
747747

748-
fn try_from(value: &ZendHashTable) -> Result<Self> {
748+
fn try_from(value: &'a ZendHashTable) -> Result<Self> {
749749
let mut vec = Vec::with_capacity(value.len());
750750

751751
for (_, _, val) in value.iter() {
@@ -788,13 +788,13 @@ where
788788
}
789789
}
790790

791-
impl<T> FromZval<'_> for Vec<T>
791+
impl<'a, T> FromZval<'a> for Vec<T>
792792
where
793-
for<'a> T: FromZval<'a>,
793+
T: FromZval<'a>,
794794
{
795795
const TYPE: DataType = DataType::Array;
796796

797-
fn from_zval(zval: &Zval) -> Option<Self> {
797+
fn from_zval(zval: &'a Zval) -> Option<Self> {
798798
zval.array().and_then(|arr| arr.try_into().ok())
799799
}
800800
}

0 commit comments

Comments
 (0)