Skip to content

Commit

Permalink
fix(macros): Explicit box dyn cast fixing Rust Analyzer troubles (#523)
Browse files Browse the repository at this point in the history
  • Loading branch information
timonv authored Jan 2, 2025
1 parent 235780b commit c35df55
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct SearchCodeArgs {
#[derive(Clone, Default)]
pub struct SearchCode {}
pub fn search_code() -> Box<dyn ::swiftide::chat_completion::Tool> {
Box::new(SearchCode {})
Box::new(SearchCode {}) as Box<dyn ::swiftide::chat_completion::Tool>
}
impl SearchCode {
pub async fn search_code(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ struct SearchCodeArgs {
#[derive(Clone, Default)]
pub struct SearchCode {}
pub fn search_code() -> Box<dyn ::swiftide::chat_completion::Tool> {
Box::new(SearchCode {})
Box::new(SearchCode {}) as Box<dyn ::swiftide::chat_completion::Tool>
}
impl SearchCode {
pub async fn search_code(
Expand Down
6 changes: 3 additions & 3 deletions swiftide-macros/src/tool/wrapped.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub(crate) fn wrap_tool_fn(input: &ItemFn) -> TokenStream {
pub struct #struct_name {}

pub fn #fn_name() -> Box<dyn ::swiftide::chat_completion::Tool> {
Box::new(#struct_name {})
Box::new(#struct_name {}) as Box<dyn ::swiftide::chat_completion::Tool>
}

impl #struct_name {
Expand Down Expand Up @@ -69,7 +69,7 @@ mod tests {
pub struct SearchCode {}

pub fn search_code() -> Box<dyn ::swiftide::chat_completion::Tool> {
Box::new(SearchCode {})
Box::new(SearchCode {}) as Box<dyn ::swiftide::chat_completion::Tool>
}

impl SearchCode {
Expand Down Expand Up @@ -98,7 +98,7 @@ mod tests {
pub struct SearchCode {}

pub fn search_code() -> Box<dyn ::swiftide::chat_completion::Tool> {
Box::new(SearchCode {})
Box::new(SearchCode {}) as Box<dyn ::swiftide::chat_completion::Tool>
}

impl SearchCode {
Expand Down

0 comments on commit c35df55

Please sign in to comment.