}
impl HandleCounters {
- // FIXME(eddyb) use a reference to the `static COUNTERS`, intead of
+ // FIXME(eddyb) use a reference to the `static COUNTERS`, instead of
// a wrapper `fn` pointer, once `const fn` can reference `static`s.
extern "C" fn get() -> &'static Self {
static COUNTERS: HandleCounters = HandleCounters {
#[repr(C)]
#[derive(Copy, Clone)]
pub struct Client<F> {
- // FIXME(eddyb) use a reference to the `static COUNTERS`, intead of
+ // FIXME(eddyb) use a reference to the `static COUNTERS`, instead of
// a wrapper `fn` pointer, once `const fn` can reference `static`s.
pub(super) get_handle_counters: extern "C" fn() -> &'static HandleCounters,
pub(super) run: extern "C" fn(Bridge<'_>, F) -> Buffer<u8>,
) -> Buffer<u8> {
run_client(bridge, |input| f(crate::TokenStream(input)).0)
}
- Client {
- get_handle_counters: HandleCounters::get,
- run,
- f,
- }
+ Client { get_handle_counters: HandleCounters::get, run, f }
}
}
impl Client<fn(crate::TokenStream, crate::TokenStream) -> crate::TokenStream> {
pub const fn expand2(
- f: fn(crate::TokenStream, crate::TokenStream) -> crate::TokenStream
+ f: fn(crate::TokenStream, crate::TokenStream) -> crate::TokenStream,
) -> Self {
extern "C" fn run(
bridge: Bridge<'_>,
f(crate::TokenStream(input), crate::TokenStream(input2)).0
})
}
- Client {
- get_handle_counters: HandleCounters::get,
- run,
- f,
- }
+ Client { get_handle_counters: HandleCounters::get, run, f }
}
}
match self {
ProcMacro::CustomDerive { trait_name, .. } => trait_name,
ProcMacro::Attr { name, .. } => name,
- ProcMacro::Bang { name, ..} => name
+ ProcMacro::Bang { name, .. } => name,
}
}
attributes: &'static [&'static str],
expand: fn(crate::TokenStream) -> crate::TokenStream,
) -> Self {
- ProcMacro::CustomDerive {
- trait_name,
- attributes,
- client: Client::expand1(expand),
- }
+ ProcMacro::CustomDerive { trait_name, attributes, client: Client::expand1(expand) }
}
pub const fn attr(
name: &'static str,
expand: fn(crate::TokenStream, crate::TokenStream) -> crate::TokenStream,
) -> Self {
- ProcMacro::Attr {
- name,
- client: Client::expand2(expand),
- }
+ ProcMacro::Attr { name, client: Client::expand2(expand) }
}
pub const fn bang(
name: &'static str,
- expand: fn(crate::TokenStream) -> crate::TokenStream
+ expand: fn(crate::TokenStream) -> crate::TokenStream,
) -> Self {
- ProcMacro::Bang {
- name,
- client: Client::expand1(expand),
- }
+ ProcMacro::Bang { name, client: Client::expand1(expand) }
}
}