1
2
3
4
5
6
7
8
9
10
11
12
13
14
use syn::parse::{Parse, ParseStream};
use syn::Result;

/// No arguments accepted by the macro.
pub struct NoArgs;
impl Parse for NoArgs {
    fn parse(input: ParseStream) -> Result<Self> {
        if input.is_empty() {
            Ok(Self)
        } else {
            Err(input.error("No argument expected"))
        }
    }
}