Skip to content

Commit 42d7abc

Browse files
authored
chore: ensure macro is prepared for potential pretty printing improvements
See rust-lang/rust#117433 (comment)
1 parent c08b875 commit 42d7abc

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

crates/macro/src/from_ast.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@ pub fn impl_from_ast(ast: &syn::DeriveInput) -> syn::Result<TokenStream> {
1212
if let Some(ast_field) = utils::find_field(fields, "ast") {
1313
let ir_crate_path = utils::get_normalized_ir_crate_path();
1414
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 ::")
15+
let ast_field_type_string = ast_field_type.to_token_stream().to_string();
16+
let ast_type = if ast_field_type_string.starts_with("ast::")
17+
|| ast_field_type_string.starts_with("ast ::")
1918
{
2019
quote! { #ast_field_type }
2120
} else {

0 commit comments

Comments
 (0)