diff options
Diffstat (limited to 'mingling_macros/src/chain.rs')
| -rw-r--r-- | mingling_macros/src/chain.rs | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/mingling_macros/src/chain.rs b/mingling_macros/src/chain.rs index 111c584..02bbc6f 100644 --- a/mingling_macros/src/chain.rs +++ b/mingling_macros/src/chain.rs @@ -153,23 +153,22 @@ fn parse_chain_attr_args(attr: TokenStream) -> (proc_macro2::TokenStream, bool) } } -/// Validates that the return type of the function is `NextProcess`. +/// Validates that the return type of the function is `Next`. fn validate_return_type_is_next_process(sig: &Signature) -> Result<(), proc_macro2::TokenStream> { match &sig.output { ReturnType::Type(_, ty) => match &**ty { Type::Path(type_path) => { let last_segment = type_path.path.segments.last().unwrap(); - if last_segment.ident != "NextProcess" { - return Err(syn::Error::new( - ty.span(), - "Chain function must return `NextProcess`", - ) - .to_compile_error()); + if last_segment.ident != "Next" { + return Err( + syn::Error::new(ty.span(), "Chain function must return `Next`") + .to_compile_error(), + ); } } _ => { return Err( - syn::Error::new(ty.span(), "Chain function must return `NextProcess`") + syn::Error::new(ty.span(), "Chain function must return `Next`") .to_compile_error(), ); } @@ -177,7 +176,7 @@ fn validate_return_type_is_next_process(sig: &Signature) -> Result<(), proc_macr ReturnType::Default => { return Err(syn::Error::new( sig.span(), - "Chain function must specify a return type (must be `NextProcess`)", + "Chain function must specify a return type (must be `Next`)", ) .to_compile_error()); } |
