From c35df5525d4d88cfb9ada89a060e1ab512b471af Mon Sep 17 00:00:00 2001 From: Timon Vonk Date: Thu, 2 Jan 2025 16:28:42 +0100 Subject: [PATCH] fix(macros): Explicit box dyn cast fixing Rust Analyzer troubles (#523) --- ...wiftide_macros__tool__tests__snapshot_multiple_args.snap | 2 +- .../swiftide_macros__tool__tests__snapshot_single_arg.snap | 2 +- swiftide-macros/src/tool/wrapped.rs | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/swiftide-macros/src/tool/snapshots/swiftide_macros__tool__tests__snapshot_multiple_args.snap b/swiftide-macros/src/tool/snapshots/swiftide_macros__tool__tests__snapshot_multiple_args.snap index 3abb9a3d..2a50766c 100644 --- a/swiftide-macros/src/tool/snapshots/swiftide_macros__tool__tests__snapshot_multiple_args.snap +++ b/swiftide-macros/src/tool/snapshots/swiftide_macros__tool__tests__snapshot_multiple_args.snap @@ -13,7 +13,7 @@ struct SearchCodeArgs { #[derive(Clone, Default)] pub struct SearchCode {} pub fn search_code() -> Box { - Box::new(SearchCode {}) + Box::new(SearchCode {}) as Box } impl SearchCode { pub async fn search_code( diff --git a/swiftide-macros/src/tool/snapshots/swiftide_macros__tool__tests__snapshot_single_arg.snap b/swiftide-macros/src/tool/snapshots/swiftide_macros__tool__tests__snapshot_single_arg.snap index 335ec21e..08be896d 100644 --- a/swiftide-macros/src/tool/snapshots/swiftide_macros__tool__tests__snapshot_single_arg.snap +++ b/swiftide-macros/src/tool/snapshots/swiftide_macros__tool__tests__snapshot_single_arg.snap @@ -12,7 +12,7 @@ struct SearchCodeArgs { #[derive(Clone, Default)] pub struct SearchCode {} pub fn search_code() -> Box { - Box::new(SearchCode {}) + Box::new(SearchCode {}) as Box } impl SearchCode { pub async fn search_code( diff --git a/swiftide-macros/src/tool/wrapped.rs b/swiftide-macros/src/tool/wrapped.rs index b56c0188..e38acefa 100644 --- a/swiftide-macros/src/tool/wrapped.rs +++ b/swiftide-macros/src/tool/wrapped.rs @@ -36,7 +36,7 @@ pub(crate) fn wrap_tool_fn(input: &ItemFn) -> TokenStream { pub struct #struct_name {} pub fn #fn_name() -> Box { - Box::new(#struct_name {}) + Box::new(#struct_name {}) as Box } impl #struct_name { @@ -69,7 +69,7 @@ mod tests { pub struct SearchCode {} pub fn search_code() -> Box { - Box::new(SearchCode {}) + Box::new(SearchCode {}) as Box } impl SearchCode { @@ -98,7 +98,7 @@ mod tests { pub struct SearchCode {} pub fn search_code() -> Box { - Box::new(SearchCode {}) + Box::new(SearchCode {}) as Box } impl SearchCode {