use ? instead of * for return types

This commit is contained in:
cyrgani 2026-02-12 11:38:22 +00:00
parent 605f49b274
commit 13189f48cf
3 changed files with 5 additions and 7 deletions

View file

@ -98,7 +98,7 @@ pub(crate) use super::symbol::Symbol;
macro_rules! define_client_side {
(
$(fn $method:ident($($arg:ident: $arg_ty:ty),* $(,)?) $(-> $ret_ty:ty)*;)*
$(fn $method:ident($($arg:ident: $arg_ty:ty),* $(,)?) $(-> $ret_ty:ty)?;)*
) => {
impl Methods {
$(pub(crate) fn $method($($arg: $arg_ty),*) $(-> $ret_ty)? {

View file

@ -133,7 +133,7 @@ impl !Sync for BridgeConfig<'_> {}
macro_rules! declare_tags {
(
$(fn $method:ident($($arg:ident: $arg_ty:ty),* $(,)?) $(-> $ret_ty:ty)*;)*
$(fn $method:ident($($arg:ident: $arg_ty:ty),* $(,)?) $(-> $ret_ty:ty)?;)*
) => {
#[allow(non_camel_case_types)]
pub(super) enum ApiTags {

View file

@ -60,7 +60,7 @@ struct Dispatcher<S: Server> {
macro_rules! define_server {
(
$(fn $method:ident($($arg:ident: $arg_ty:ty),* $(,)?) $(-> $ret_ty:ty)*;)*
$(fn $method:ident($($arg:ident: $arg_ty:ty),* $(,)?) $(-> $ret_ty:ty)?;)*
) => {
pub trait Server {
type TokenStream: 'static + Clone + Default;
@ -83,7 +83,7 @@ with_api!(define_server, Self::TokenStream, Self::Span, Self::Symbol);
macro_rules! define_dispatcher {
(
$(fn $method:ident($($arg:ident: $arg_ty:ty),* $(,)?) $(-> $ret_ty:ty)*;)*
$(fn $method:ident($($arg:ident: $arg_ty:ty),* $(,)?) $(-> $ret_ty:ty)?;)*
) => {
// FIXME(eddyb) `pub` only for `ExecutionStrategy` below.
pub trait DispatcherTrait {
@ -100,9 +100,7 @@ macro_rules! define_dispatcher {
let mut call_method = || {
$(let $arg = <$arg_ty>::decode(&mut reader, handle_store).unmark();)*
let r = server.$method($($arg),*);
$(
let r: $ret_ty = Mark::mark(r);
)*
$(let r: $ret_ty = Mark::mark(r);)?
r
};
// HACK(eddyb) don't use `panic::catch_unwind` in a panic.