Skip to content

Commit 1381268

Browse files
committed
use Uuid:::from_u128 for uuid_to_string
1 parent 0e6b377 commit 1381268

File tree

1 file changed

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

1 file changed

+3
-1
lines changed

src/serializers/type_serializers/uuid.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ use super::{
1111
};
1212

1313
pub(crate) fn uuid_to_string(py_uuid: &Bound<'_, PyAny>) -> PyResult<String> {
14-
Ok(py_uuid.str()?.to_string())
14+
let uuid_int_val: u128 = py_uuid.getattr("int")?.extract()?;
15+
let uuid = Uuid::from_u128(uuid_int_val);
16+
Ok(uuid.to_string())
1517
}
1618

1719
#[derive(Debug, Clone)]

0 commit comments

Comments
 (0)