From 37c5ff4c6dcf7ddd6e3844547958485ac356405f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kre=C5=A1imir=20Klas?= Date: Sun, 5 Jun 2022 02:34:47 +0200 Subject: [PATCH] lang: strip Box when parsing idl types (#1947) --- lang/syn/src/idl/file.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lang/syn/src/idl/file.rs b/lang/syn/src/idl/file.rs index 908c9acff..23e813aa5 100644 --- a/lang/syn/src/idl/file.rs +++ b/lang/syn/src/idl/file.rs @@ -605,6 +605,13 @@ fn to_idl_type(ctx: &CrateContext, ty: &syn::Type) -> IdlType { if tts_string.starts_with('[') { tts_string = resolve_variable_array_lengths(ctx, tts_string); } + // Box -> FooType + tts_string = tts_string + .strip_prefix("Box < ") + .and_then(|t| t.strip_suffix(" >")) + .unwrap_or(&tts_string) + .into(); + tts_string.parse().unwrap() }