We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent acf5d8d commit 5530e72Copy full SHA for 5530e72
lang/syn/src/idl/defined.rs
@@ -497,8 +497,10 @@ pub fn gen_idl_type(
497
use quote::ToTokens;
498
499
// If no path was found, just return an empty path and let the find_path function handle it
500
- let source_path = proc_macro2::Span::call_site().local_file().unwrap_or(std::path::PathBuf::new());
501
-
+ let source_path = proc_macro2::Span::call_site()
+ .local_file()
502
+ .unwrap_or_default();
503
+
504
if let Ok(Ok(ctx)) = find_path("lib.rs", &source_path).map(CrateContext::parse) {
505
let name = path.path.segments.last().unwrap().ident.to_string();
506
let alias = ctx.type_aliases().find(|ty| ty.ident == name);
0 commit comments