feat: FromPyFromStr and ToStrToPy macros YAY

This commit is contained in:
J / Jacob Babich
2026-07-09 01:35:49 -04:00
parent c637ad2d76
commit 9a9cefee37
25 changed files with 343 additions and 394 deletions

View File

@@ -1,10 +1,10 @@
use std::{str::FromStr, sync::Arc};
use pyo3::{exceptions::PyValueError, PyErr};
use python_utils::{FromPyFromStr, ToStrToPy};
use snafu::Snafu;
// TODO: derive(PyFromStr) (analogous to serde_with::DeserializeFromStr) once I make one
#[derive(Debug, Clone, derive_more::Display)]
#[derive(Debug, Clone, derive_more::Display, FromPyFromStr, ToStrToPy)]
pub struct Slug(Arc<str>);
#[derive(Debug, Clone, Snafu)]