Remove redundant Option from eager macro fns

This commit is contained in:
Jonas Schievink 2022-01-21 12:58:06 +01:00
parent df53403863
commit e5ed43b1dc
2 changed files with 24 additions and 22 deletions

View file

@ -145,14 +145,16 @@ pub fn expand_eager_macro(
if let MacroDefKind::BuiltInEager(eager, _) = def.kind {
let res = eager.expand(db, arg_id, &subtree);
if let Some(err) = res.err {
diagnostic_sink(err);
}
let expanded = diagnostic_sink.expand_result_option(res)?;
let loc = MacroCallLoc {
def,
krate,
eager: Some(EagerCallInfo {
arg_or_expansion: Arc::new(expanded.subtree),
included_file: expanded.included_file,
arg_or_expansion: Arc::new(res.value.subtree),
included_file: res.value.included_file,
}),
kind: MacroCallKind::FnLike { ast_id: call_id, expand_to },
};