Skip to content

Commit

Permalink
Merge pull request #7 from jucr-io/method-no-return-val
Browse files Browse the repository at this point in the history
Handle method w/o return values
  • Loading branch information
kkrolczyk authored Jul 29, 2024
2 parents 8cabed4 + 150b3d3 commit b4e0d76
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ impl Controller {
self.set_state(State::Disabled).await;
Ok(())
}
}
// Method that doesn't return anything.
pub async fn return_nothing(&self) {
}
}
#[embassy_executor::main]
Expand Down
7 changes: 1 addition & 6 deletions src/controller/item_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,7 @@ impl ProxiedMethodArgs<'_> {
let in_args = MethodInputArgs::parse(method)?;
let out_type = match &method.sig.output {
syn::ReturnType::Type(_, ty) => quote! { #ty },
syn::ReturnType::Default => {
return Err(syn::Error::new(
method.sig.ident.span(),
"Expected return type in method signature",
))
}
syn::ReturnType::Default => quote! { () },
};

Ok(ProxiedMethodArgs {
Expand Down

0 comments on commit b4e0d76

Please sign in to comment.