Skip to content

Commit 5530e72

Browse files
committed
unwrap_or_default + fmt
1 parent acf5d8d commit 5530e72

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lang/syn/src/idl/defined.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,8 +497,10 @@ pub fn gen_idl_type(
497497
use quote::ToTokens;
498498

499499
// 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-
500+
let source_path = proc_macro2::Span::call_site()
501+
.local_file()
502+
.unwrap_or_default();
503+
502504
if let Ok(Ok(ctx)) = find_path("lib.rs", &source_path).map(CrateContext::parse) {
503505
let name = path.path.segments.last().unwrap().ident.to_string();
504506
let alias = ctx.type_aliases().find(|ty| ty.ident == name);

0 commit comments

Comments
 (0)