Skip to content

Commit 6e717c3

Browse files
committed
Fix tests
1 parent 36f52e3 commit 6e717c3

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

‎tests/test_custom_types.rs‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ impl PythonizeListType for CustomList {
5656
}
5757

5858
struct PythonizeCustomList;
59-
impl<'py> PythonizeTypes for PythonizeCustomList {
59+
impl PythonizeTypes for PythonizeCustomList {
6060
type Map = PyDict;
6161
type NamedMap = PythonizeUnnamedMappingAdapter<PyDict>;
6262
type List = CustomList;
@@ -103,6 +103,10 @@ impl CustomDict {
103103
fn values(&self) -> Vec<Py<PyAny>> {
104104
self.items.values().cloned().collect()
105105
}
106+
107+
fn items(&self) -> Vec<(&String, Py<PyAny>)> {
108+
self.items.iter().map(|(k, v)| (k, v.clone())).collect()
109+
}
106110
}
107111

108112
impl PythonizeMappingType for CustomDict {
@@ -131,7 +135,7 @@ impl PythonizeMappingType for CustomDict {
131135
}
132136

133137
struct PythonizeCustomDict;
134-
impl<'py> PythonizeTypes for PythonizeCustomDict {
138+
impl PythonizeTypes for PythonizeCustomDict {
135139
type Map = CustomDict;
136140
type NamedMap = PythonizeUnnamedMappingAdapter<CustomDict>;
137141
type List = PyTuple;
@@ -215,6 +219,10 @@ impl NamedCustomDict {
215219
fn values(&self) -> Vec<Py<PyAny>> {
216220
self.items.values().cloned().collect()
217221
}
222+
223+
fn items(&self) -> Vec<(&String, Py<PyAny>)> {
224+
self.items.iter().map(|(k, v)| (k, v.clone())).collect()
225+
}
218226
}
219227

220228
impl PythonizeNamedMappingType for NamedCustomDict {
@@ -248,7 +256,7 @@ impl PythonizeNamedMappingType for NamedCustomDict {
248256
}
249257

250258
struct PythonizeNamedCustomDict;
251-
impl<'py> PythonizeTypes for PythonizeNamedCustomDict {
259+
impl PythonizeTypes for PythonizeNamedCustomDict {
252260
type Map = CustomDict;
253261
type NamedMap = NamedCustomDict;
254262
type List = PyTuple;

0 commit comments

Comments
 (0)