mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
fix clippy::needless_borrow
This commit is contained in:
parent
ff7e057dca
commit
7912e33ed6
36 changed files with 74 additions and 77 deletions
|
@ -170,9 +170,9 @@ fn convert_tokens<C: TokenConvertor>(conv: &mut C) -> tt::Subtree {
|
|||
Some(it) => it,
|
||||
None => break,
|
||||
};
|
||||
let synth_id = token.synthetic_id(&conv);
|
||||
let synth_id = token.synthetic_id(conv);
|
||||
|
||||
let kind = token.kind(&conv);
|
||||
let kind = token.kind(conv);
|
||||
if kind == COMMENT {
|
||||
if let Some(tokens) = conv.convert_doc_comment(&token) {
|
||||
// FIXME: There has to be a better way to do this
|
||||
|
@ -227,7 +227,7 @@ fn convert_tokens<C: TokenConvertor>(conv: &mut C) -> tt::Subtree {
|
|||
continue;
|
||||
}
|
||||
|
||||
let spacing = match conv.peek().map(|next| next.kind(&conv)) {
|
||||
let spacing = match conv.peek().map(|next| next.kind(conv)) {
|
||||
Some(kind)
|
||||
if !kind.is_trivia()
|
||||
&& kind.is_punct()
|
||||
|
@ -240,7 +240,7 @@ fn convert_tokens<C: TokenConvertor>(conv: &mut C) -> tt::Subtree {
|
|||
}
|
||||
_ => tt::Spacing::Alone,
|
||||
};
|
||||
let char = match token.to_char(&conv) {
|
||||
let char = match token.to_char(conv) {
|
||||
Some(c) => c,
|
||||
None => {
|
||||
panic!("Token from lexer must be single char: token = {:#?}", token);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue