@@ -23,8 +23,6 @@ fn repr(py: Python, obj: PyObject) -> PyResult<String> {
2323 obj. call_method ( py, "__repr__" , ( ) , None ) ?. extract ( py)
2424}
2525
26- trait SizedIntoPy : IntoPy < PyObject > + Sized { }
27-
2826// Create a dataclass-like repr, of the name of the class of the object
2927// called with the repr of the fields
3028fn data_repr ( py : Python , obj : PyObject , field_names : Vec < & str > ) -> PyResult < String > {
@@ -39,12 +37,12 @@ fn data_repr(py: Python, obj: PyObject, field_names: Vec<&str>) -> PyResult<Stri
3937 Ok ( format ! ( "{}({})" , class_name, field_strings?. join( ", " ) ) )
4038}
4139
42- #[ pyclass( name = "Variant" ) ]
40+ #[ pyclass]
4341#[ derive( Clone ) ]
44- pub ( crate ) struct WrappedVariant ( egg_smol:: ast:: Variant ) ;
42+ pub struct Variant ( pub egg_smol:: ast:: Variant ) ;
4543
4644#[ pymethods]
47- impl WrappedVariant {
45+ impl Variant {
4846 #[ new]
4947 fn new ( name : String , types : Vec < String > , cost : Option < usize > ) -> Self {
5048 Self ( egg_smol:: ast:: Variant {
@@ -75,18 +73,6 @@ impl WrappedVariant {
7573 }
7674}
7775
78- impl From < WrappedVariant > for egg_smol:: ast:: Variant {
79- fn from ( other : WrappedVariant ) -> Self {
80- other. 0
81- }
82- }
83-
84- impl From < egg_smol:: ast:: Variant > for WrappedVariant {
85- fn from ( other : egg_smol:: ast:: Variant ) -> Self {
86- WrappedVariant ( other)
87- }
88- }
89-
9076// Wrapped version of FunctionDecl
9177pub struct WrappedFunctionDecl ( egg_smol:: ast:: FunctionDecl ) ;
9278impl FromPyObject < ' _ > for WrappedFunctionDecl {
0 commit comments