mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
fix clippy::needless_borrow
This commit is contained in:
parent
ff7e057dca
commit
7912e33ed6
36 changed files with 74 additions and 77 deletions
|
@ -149,11 +149,11 @@ pub fn expand_speculative(
|
|||
let token_range = token_to_map.text_range();
|
||||
|
||||
// Build the subtree and token mapping for the speculative args
|
||||
let censor = censor_for_macro_input(&loc, &speculative_args);
|
||||
let mut fixups = fixup::fixup_syntax(&speculative_args);
|
||||
let censor = censor_for_macro_input(&loc, speculative_args);
|
||||
let mut fixups = fixup::fixup_syntax(speculative_args);
|
||||
fixups.replace.extend(censor.into_iter().map(|node| (node, Vec::new())));
|
||||
let (mut tt, spec_args_tmap, _) = mbe::syntax_node_to_token_tree_with_modifications(
|
||||
&speculative_args,
|
||||
speculative_args,
|
||||
fixups.token_map,
|
||||
fixups.next_id,
|
||||
fixups.replace,
|
||||
|
|
|
@ -207,7 +207,7 @@ fn eager_macro_recur(
|
|||
|
||||
// Collect replacement
|
||||
for child in children {
|
||||
let def = match child.path().and_then(|path| ModPath::from_src(db, path, &hygiene)) {
|
||||
let def = match child.path().and_then(|path| ModPath::from_src(db, path, hygiene)) {
|
||||
Some(path) => macro_resolver(path.clone()).ok_or_else(|| UnresolvedMacro { path })?,
|
||||
None => {
|
||||
diagnostic_sink(ExpandError::Other("malformed macro invocation".into()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue