fix clippy::needless_borrow

This commit is contained in:
Matthias Krüger 2022-03-12 13:04:13 +01:00
parent ff7e057dca
commit 7912e33ed6
36 changed files with 74 additions and 77 deletions

View file

@ -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,

View file

@ -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()));