Skip to content

Commit 40140ac

Browse files
committed
Use static names
1 parent 5211ccf commit 40140ac

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

src/ser.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@ pub trait PythonizeNamedMappingType {
2424
type Builder<'py>: MappingBuilder<'py>;
2525

2626
/// Create a builder for a Python mapping with a name
27-
fn create_builder<'py>(py: Python<'py>, len: usize, name: &str)
28-
-> PyResult<Self::Builder<'py>>;
27+
fn create_builder<'py>(
28+
py: Python<'py>,
29+
len: usize,
30+
name: &'static str,
31+
) -> PyResult<Self::Builder<'py>>;
2932
}
3033

3134
/// Trait for types which can build a Python mapping
@@ -73,7 +76,7 @@ impl PythonizeNamedMappingType for PyDict {
7376
fn create_builder<'py>(
7477
py: Python<'py>,
7578
_len: usize,
76-
_name: &str,
79+
_name: &'static str,
7780
) -> PyResult<Self::Builder<'py>> {
7881
Ok(Self::new_bound(py))
7982
}

tests/test_custom_types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ impl PythonizeNamedMappingType for CustomDict {
125125
fn create_builder<'py>(
126126
py: Python<'py>,
127127
len: usize,
128-
_name: &str,
128+
_name: &'static str,
129129
) -> PyResult<Self::Builder<'py>> {
130130
Bound::new(
131131
py,

0 commit comments

Comments
 (0)