portrait_framework/
no_args.rs

1use syn::parse::{Parse, ParseStream};
2use syn::Result;
3
4/// No arguments accepted by the macro.
5pub struct NoArgs;
6
7impl Parse for NoArgs {
8    fn parse(input: ParseStream) -> Result<Self> {
9        if input.is_empty() {
10            Ok(Self)
11        } else {
12            Err(input.error("No argument expected"))
13        }
14    }
15}