Skip to content

Commit 9db046f

Browse files
committed
use py03 intern macro
1 parent 8d7f211 commit 9db046f

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,7 +1,7 @@
11
use std::borrow::Cow;
22

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

77
use crate::definitions::DefinitionsBuilder;
@@ -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)