Skip to content

Commit

Permalink
chore: ensure macro is prepared for potential pretty printing improve…
Browse files Browse the repository at this point in the history
  • Loading branch information
tjallingt authored Nov 8, 2023
1 parent c08b875 commit 42d7abc
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions crates/macro/src/from_ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ pub fn impl_from_ast(ast: &syn::DeriveInput) -> syn::Result<TokenStream> {
if let Some(ast_field) = utils::find_field(fields, "ast") {
let ir_crate_path = utils::get_normalized_ir_crate_path();
let ast_field_type = &ast_field.ty;
let ast_type = if ast_field_type
.to_token_stream()
.to_string()
.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 ::")
{
quote! { #ast_field_type }
} else {
Expand Down

0 comments on commit 42d7abc

Please sign in to comment.