Skip to content

Commit 3ee5115

Browse files
committed
use py03 intern macro
1 parent 8d7f211 commit 3ee5115

File tree

1 file changed

+3
-2
lines changed
  • src/serializers/type_serializers

1 file changed

+3
-2
lines changed

src/serializers/type_serializers/uuid.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::borrow::Cow;
22

3-
use pyo3::prelude::*;
3+
use pyo3::{intern, prelude::*};
44
use pyo3::types::PyDict;
55
use uuid::Uuid;
66

@@ -12,7 +12,8 @@ use super::{
1212
};
1313

1414
pub(crate) fn uuid_to_string(py_uuid: &Bound<'_, PyAny>) -> PyResult<String> {
15-
let uuid_int_val: u128 = py_uuid.getattr("int")?.extract()?;
15+
let py = py_uuid.py();
16+
let uuid_int_val: u128 = py_uuid.getattr(intern!(py,"int"))?.extract()?;
1617
let uuid = Uuid::from_u128(uuid_int_val);
1718
Ok(uuid.to_string())
1819
}

0 commit comments

Comments
 (0)