Python: Remove unused PyValueRef type

This commit is contained in:
Simon Hausmann 2025-05-16 16:58:24 +02:00 committed by Simon Hausmann
parent d4439231eb
commit b1f0e5fe81

View file

@ -10,24 +10,12 @@ use std::collections::HashMap;
#[gen_stub_pyclass]
pub struct PyValue(pub slint_interpreter::Value);
struct PyValueRef<'a>(&'a slint_interpreter::Value);
impl<'py> IntoPyObject<'py> for PyValue {
type Target = PyAny;
type Output = Bound<'py, Self::Target>;
type Error = PyErr;
fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error> {
// Share the conversion code below that operates on the reference
PyValueRef(&self.0).into_pyobject(py)
}
}
impl<'a, 'py> IntoPyObject<'py> for PyValueRef<'a> {
type Target = PyAny;
type Output = Bound<'py, Self::Target>;
type Error = PyErr;
fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error> {
match &self.0 {
slint_interpreter::Value::Void => ().into_bound_py_any(py),