We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c08b875 commit 42d7abcCopy full SHA for 42d7abc
crates/macro/src/from_ast.rs
@@ -12,10 +12,9 @@ pub fn impl_from_ast(ast: &syn::DeriveInput) -> syn::Result<TokenStream> {
12
if let Some(ast_field) = utils::find_field(fields, "ast") {
13
let ir_crate_path = utils::get_normalized_ir_crate_path();
14
let ast_field_type = &ast_field.ty;
15
- let ast_type = if ast_field_type
16
- .to_token_stream()
17
- .to_string()
18
- .starts_with("ast ::")
+ let ast_field_type_string = ast_field_type.to_token_stream().to_string();
+ let ast_type = if ast_field_type_string.starts_with("ast::")
+ || ast_field_type_string.starts_with("ast ::")
19
{
20
quote! { #ast_field_type }
21
} else {
0 commit comments