mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 13:03:31 +00:00
Merge #2614
2614: Clippy cleanup r=matklad a=kjeremy Just a few tweaks from the latest clippy. There are a lot more but we should probably tweak our settings. Co-authored-by: kjeremy <kjeremy@gmail.com>
This commit is contained in:
commit
af5e2abe15
2 changed files with 3 additions and 3 deletions
|
@ -108,7 +108,7 @@ fn stringify_expand(
|
|||
|
||||
let macro_content = {
|
||||
let arg = loc.kind.arg(db).ok_or_else(|| mbe::ExpandError::UnexpectedToken)?;
|
||||
let macro_args = arg.clone();
|
||||
let macro_args = arg;
|
||||
let text = macro_args.text();
|
||||
let without_parens = TextUnit::of_char('(')..text.len() - TextUnit::of_char(')');
|
||||
text.slice(without_parens).to_string()
|
||||
|
|
|
@ -104,7 +104,7 @@ impl ast::ItemList {
|
|||
}
|
||||
};
|
||||
|
||||
let indent = leading_indent(self.syntax()).unwrap_or("".into());
|
||||
let indent = leading_indent(self.syntax()).unwrap_or_default();
|
||||
let ws = tokens::WsBuilder::new(&format!("\n{}", indent));
|
||||
let to_insert = iter::once(ws.ws().into());
|
||||
match existing_ws {
|
||||
|
@ -133,7 +133,7 @@ impl ast::RecordFieldList {
|
|||
let space = if is_multiline {
|
||||
ws = tokens::WsBuilder::new(&format!(
|
||||
"\n{} ",
|
||||
leading_indent(self.syntax()).unwrap_or("".into())
|
||||
leading_indent(self.syntax()).unwrap_or_default()
|
||||
));
|
||||
ws.ws()
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue