diff --git a/rust/altrios-core/altrios-proc-macros/src/altrios_api/mod.rs b/rust/altrios-core/altrios-proc-macros/src/altrios_api/mod.rs index 846227a7..dcbc349e 100644 --- a/rust/altrios-core/altrios-proc-macros/src/altrios_api/mod.rs +++ b/rust/altrios-core/altrios-proc-macros/src/altrios_api/mod.rs @@ -94,7 +94,8 @@ pub(crate) fn altrios_api(attr: TokenStream, item: TokenStream) -> TokenStream { quote! { #[new] /// Rust-defined `__new__` magic method for Python used exposed via PyO3. - fn __new__(v: &mut Vec<#contained_dtype>) -> PyResult { + fn __new__(v: Vec<#contained_dtype>) -> PyResult { + let mut v = v.clone(); v.init()?; Self(v) }