mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
Remove redundant Option
from eager macro fns
This commit is contained in:
parent
df53403863
commit
e5ed43b1dc
2 changed files with 24 additions and 22 deletions
|
@ -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 },
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue