allow rsx to be used outside of a proc_macro context
This commit is contained in:
1 parent
4b1ea5879d
commit
06390b9be5
8 files changed
+30
-46
No files matched your search
@@ -14,11 +14,12 @@
|
||||
use super::*;
|
||||
|
||||
use proc_macro2::TokenStream as TokenStream2;
|
||||
#[cfg(feature = "to_tokens")]
|
||||
use quote::{quote, ToTokens, TokenStreamExt};
|
||||
use syn::{
|
||||
ext::IdentExt,
|
||||
parse::{Parse, ParseBuffer, ParseStream},
|
||||
token, Expr, Ident, LitStr, Result, Token,
|
||||
token, Error, Expr, Ident, LitStr, Result, Token,
|
||||
};
|
||||
|
||||
#[derive(PartialEq, Eq)]
|
||||
@@ -72,6 +73,7 @@ impl Parse for Component {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "to_tokens")]
|
||||
impl ToTokens for Component {
|
||||
fn to_tokens(&self, tokens: &mut TokenStream2) {
|
||||
let name = &self.name;
|
||||
|
||||
Reference in new issue
Block a user