···3636/// Marks a `struct` as a router or marks an `impl` block as a router
3737/// implementation
3838///
3939+/// # Panics
4040+///
4141+/// Panics if used on an item that is not a `struct` or `impl` block.
4242+///
3943/// # Examples
4044///
4145/// ```rust
···5761/// ```
5862#[proc_macro_attribute]
5963pub fn router(arguments: TokenStream, item: TokenStream) -> TokenStream {
6060- let output = match syn::parse::<Item>(item.clone()) {
6464+ match syn::parse::<Item>(item) {
6165 Ok(Item::Struct(item)) => implementations::fields(arguments, item),
6266 Ok(Item::Impl(item)) => implementations::methods(arguments, item),
6367 _ => panic!("`#[rossweisse::router]` can only be used on `struct`s"),
6464- };
6565-6666- output.into()
6868+ }
6769}
68706971/// Marks a method of a router implementation as a route to mount
7072///
7373+/// # Panics
7474+///
7575+/// Panics if used on an item that is not a function.
7676+///
7177/// # Examples
7278///
7379/// ```rust
···8490/// ```
8591#[proc_macro_attribute]
8692pub fn route(arguments: TokenStream, item: TokenStream) -> TokenStream {
8787- let output = match syn::parse::<Item>(item.clone()) {
8888- Ok(Item::Fn(item)) => implementations::route(arguments, item),
9393+ match syn::parse::<Item>(item) {
9494+ Ok(Item::Fn(ref item)) => implementations::route(arguments, item),
8995 _ => panic!("`#[rossweisse::route]` can only be used on `fn`s"),
9090- };
9191-9292- output.into()
9696+ }
9397}