chore: take Python<'_> as a parameter instead of &Python

This commit is contained in:
2025-03-22 16:49:45 -04:00
parent 7b2ebc5fe9
commit 70dda580ee
3 changed files with 16 additions and 16 deletions

View File

@@ -23,11 +23,11 @@ impl<'py> FromPyObject<'py> for StateMachine {
impl StateMachine {
pub fn get<Attributes: for<'py> FromPyObject<'py>, ContextEvent: for<'py> FromPyObject<'py>>(
&self,
py: &Python,
py: Python<'_>,
entity_id: EntityId,
) -> Result<Option<State<Attributes, ContextEvent>>, PyErr> {
) -> PyResult<Option<State<Attributes, ContextEvent>>> {
let args = (entity_id.to_string(),);
let state = self.0.call_method1(*py, "get", args)?;
state.extract(*py)
let state = self.0.call_method1(py, "get", args)?;
state.extract(py)
}
}