mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2026-08-07 14:16:56 +02:00
dizzle: use procmacro in examples
This commit is contained in:
parent
7a0459756e
commit
be98e666f5
7 changed files with 53 additions and 61 deletions
|
|
@ -50,26 +50,6 @@ pub fn view (meta: TokenStream, item: TokenStream) -> TokenStream {
|
|||
))
|
||||
}
|
||||
|
||||
pub(crate) fn write <T: ToTokens> (t: T) -> TokenStream {
|
||||
let mut out = TokenStream2::new();
|
||||
t.to_tokens(&mut out);
|
||||
out.into()
|
||||
}
|
||||
|
||||
pub(crate) fn write_quote (quote: TokenStream2) -> TokenStream2 {
|
||||
let mut out = TokenStream2::new();
|
||||
for token in quote {
|
||||
out.append(token);
|
||||
}
|
||||
out
|
||||
}
|
||||
|
||||
pub(crate) fn write_quote_to (out: &mut TokenStream2, quote: TokenStream2) {
|
||||
for token in quote {
|
||||
out.append(token);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)] #[test] fn test_proc_view () {
|
||||
let x: crate::proc_view::ViewMeta = pq! { SomeOut };
|
||||
let output: Ident = pq! { SomeOut };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue