use super::prelude::*;
pub use proc_macro2::Span as DelimSpan;
pub use syn::spanned::Spanned;
pub trait AttributeExt1 {
fn path(&self) -> &syn::Path;
}
impl AttributeExt1 for syn::Attribute {
fn path(&self) -> &syn::Path {
&self.path
}
}
impl AttributeExt12 for syn::Attribute {
fn call_in_parens<T, F>(&self, f: F) -> syn::Result<T>
where
F: FnOnce(ParseStream<'_>) -> syn::Result<T>,
{
(|outer: ParseStream<'_>| {
let inner;
let _paren = parenthesized!(inner in outer);
f(&inner)
})
.parse2(self.tokens.clone())
}
}
pub trait VisPublicExt {
fn pub_token(self) -> syn::token::Pub;
}
impl VisPublicExt for syn::VisPublic {
fn pub_token(self) -> syn::token::Pub {
self.pub_token
}
}