From 0277ac77841cad2abb0c7a25f3c1f8e6c912462a Mon Sep 17 00:00:00 2001 From: Toshiki Teramura Date: Thu, 22 Aug 2024 14:25:36 +0900 Subject: [PATCH] Support remove_lifetime for Tuple and Array --- pyo3-stub-gen-derive/src/gen_stub/util.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pyo3-stub-gen-derive/src/gen_stub/util.rs b/pyo3-stub-gen-derive/src/gen_stub/util.rs index 50aa9e3..a3e1107 100644 --- a/pyo3-stub-gen-derive/src/gen_stub/util.rs +++ b/pyo3-stub-gen-derive/src/gen_stub/util.rs @@ -36,6 +36,14 @@ pub fn remove_lifetime(ty: &mut Type) { rty.lifetime = None; remove_lifetime(rty.elem.as_mut()); } + Type::Tuple(ty) => { + for elem in &mut ty.elems { + remove_lifetime(elem); + } + } + Type::Array(ary) => { + remove_lifetime(ary.elem.as_mut()); + } _ => {} } }