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:
bors[bot] 2019-12-20 14:46:24 +00:00 committed by GitHub
commit af5e2abe15
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

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

View file

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