Skip to content

Commit

Permalink
stringify type when skipping
Browse files Browse the repository at this point in the history
  • Loading branch information
ralexstokes committed Apr 8, 2024
1 parent c2d8cff commit dc5ca4e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion spec-gen/src/visitors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use syn::{
parse_quote, visit, visit::Visit, visit_mut, visit_mut::VisitMut,
AngleBracketedGenericArguments, Generics, Ident, ItemFn, Type,
};
use quote::quote;

pub fn as_syn_ident(s: String) -> Ident {
syn::parse_str(&s).unwrap()
Expand Down Expand Up @@ -202,7 +203,10 @@ impl<'ast> Visit<'ast> for TypeNameVisitor {
visit::visit_type_path(self, node);
self.in_context = false;
}
ty => println!("skipping type during visit: {ty:?}"),
ty => {
let ty_str = quote!(#ty).to_string();
println!("skipping type during visit: `{ty_str}`");
}
}
visit::visit_pat_type(self, i);
}
Expand Down

0 comments on commit dc5ca4e

Please sign in to comment.