mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-14 09:40:10 +00:00
fixup! cargo fmt
This commit is contained in:
parent
be218c89cc
commit
3b2c1332c2
10 changed files with 99 additions and 72 deletions
|
|
@ -9,7 +9,7 @@ fn pretty_print(ts: &proc_macro2::TokenStream) -> String {
|
|||
pub fn macro_impl(
|
||||
_args: proc_macro::TokenStream,
|
||||
input: proc_macro::TokenStream,
|
||||
is_internal: bool,
|
||||
is_internal: bool,
|
||||
) -> proc_macro::TokenStream {
|
||||
let input = parse_macro_input!(input as ItemFn);
|
||||
|
||||
|
|
@ -35,15 +35,15 @@ pub fn macro_impl(
|
|||
})
|
||||
.collect();
|
||||
|
||||
let internal_res = if is_internal {
|
||||
quote! {
|
||||
if !auth.internal() {
|
||||
return crate::error::FORBIDDEN_INTERNAL_ROUTE.into_response();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
quote!()
|
||||
};
|
||||
let internal_res = if is_internal {
|
||||
quote! {
|
||||
if !auth.internal() {
|
||||
return crate::error::FORBIDDEN_INTERNAL_ROUTE.into_response();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
quote!()
|
||||
};
|
||||
|
||||
let res = quote! {
|
||||
#[allow(unused_mut)]
|
||||
|
|
@ -52,7 +52,7 @@ pub fn macro_impl(
|
|||
#fn_body
|
||||
}
|
||||
|
||||
#internal_res
|
||||
#internal_res
|
||||
match inner(#(#pms),*).await {
|
||||
Ok(res) => res.into_response(),
|
||||
Err(err) => err.into_response(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue