Skip to content

Commit 4fe4c30

Browse files
committed
Improve readability
1 parent 783c6a3 commit 4fe4c30

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

crates/hir_def/src/body.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,16 @@ impl Expander {
105105

106106
let macro_call = InFile::new(self.current_file_id, &macro_call);
107107

108-
if let Some(call_id) = macro_call.as_call_id(db, self.crate_def_map.krate, |path| {
108+
let resolver = |path: ModPath| -> Option<MacroDefId> {
109109
if let Some(local_scope) = local_scope {
110110
if let Some(def) = path.as_ident().and_then(|n| local_scope.get_legacy_macro(n)) {
111111
return Some(def);
112112
}
113113
}
114114
self.resolve_path_as_macro(db, &path)
115-
}) {
115+
};
116+
117+
if let Some(call_id) = macro_call.as_call_id(db, self.crate_def_map.krate, resolver) {
116118
let file_id = call_id.as_file();
117119
if let Some(node) = db.parse_or_expand(file_id) {
118120
if let Some(expr) = T::cast(node) {

0 commit comments

Comments
 (0)