mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 05:45:12 +00:00
clippy::redudant_borrow
This commit is contained in:
parent
d6737e55fb
commit
c9b4ac5be4
114 changed files with 285 additions and 285 deletions
|
@ -354,7 +354,7 @@ fn concat_expand(
|
|||
// concat works with string and char literals, so remove any quotes.
|
||||
// It also works with integer, float and boolean literals, so just use the rest
|
||||
// as-is.
|
||||
let component = unquote_str(&it).unwrap_or_else(|| it.text.to_string());
|
||||
let component = unquote_str(it).unwrap_or_else(|| it.text.to_string());
|
||||
text.push_str(&component);
|
||||
}
|
||||
// handle boolean literals
|
||||
|
@ -417,7 +417,7 @@ fn parse_string(tt: &tt::Subtree) -> Result<String, mbe::ExpandError> {
|
|||
tt.token_trees
|
||||
.get(0)
|
||||
.and_then(|tt| match tt {
|
||||
tt::TokenTree::Leaf(tt::Leaf::Literal(it)) => unquote_str(&it),
|
||||
tt::TokenTree::Leaf(tt::Leaf::Literal(it)) => unquote_str(it),
|
||||
_ => None,
|
||||
})
|
||||
.ok_or_else(|| mbe::ExpandError::ConversionError)
|
||||
|
@ -561,7 +561,7 @@ mod tests {
|
|||
use syntax::ast::NameOwner;
|
||||
|
||||
fn expand_builtin_macro(ra_fixture: &str) -> String {
|
||||
let (db, file_id) = TestDB::with_single_file(&ra_fixture);
|
||||
let (db, file_id) = TestDB::with_single_file(ra_fixture);
|
||||
let parsed = db.parse(file_id);
|
||||
let mut macro_rules: Vec<_> =
|
||||
parsed.syntax_node().descendants().filter_map(ast::MacroRules::cast).collect();
|
||||
|
|
|
@ -78,7 +78,7 @@ mod tests {
|
|||
use super::*;
|
||||
|
||||
fn test_remove_derives_up_to(attr: usize, ra_fixture: &str, expect: Expect) {
|
||||
let (db, file_id) = TestDB::with_single_file(&ra_fixture);
|
||||
let (db, file_id) = TestDB::with_single_file(ra_fixture);
|
||||
let parsed = db.parse(file_id);
|
||||
|
||||
let mut items: Vec<_> =
|
||||
|
|
|
@ -51,7 +51,7 @@ impl ProcMacroExpander {
|
|||
// Proc macros have access to the environment variables of the invoking crate.
|
||||
let env = &krate_graph[calling_crate].env;
|
||||
|
||||
proc_macro.expander.expand(&tt, attr_arg, &env).map_err(mbe::ExpandError::from)
|
||||
proc_macro.expander.expand(tt, attr_arg, env).map_err(mbe::ExpandError::from)
|
||||
}
|
||||
None => Err(mbe::ExpandError::UnresolvedProcMacro),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue