diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-12-20 14:46:24 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2019-12-20 14:46:24 +0000 |
commit | af5e2abe15c2bf182b871e26a680507a51526176 (patch) | |
tree | 98b334b70fce0548be6cf67301d31c2dc4444f64 | |
parent | d590f6ce12bf4d0311138846e26951b613f0afd4 (diff) | |
parent | f22aabc1360eb7e900a4495bc68f3302c7c49a7c (diff) |
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 <[email protected]>
-rw-r--r-- | crates/ra_hir_expand/src/builtin_macro.rs | 2 | ||||
-rw-r--r-- | crates/ra_syntax/src/ast/edit.rs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_hir_expand/src/builtin_macro.rs b/crates/ra_hir_expand/src/builtin_macro.rs index d2b3d769e..1749b491b 100644 --- a/crates/ra_hir_expand/src/builtin_macro.rs +++ b/crates/ra_hir_expand/src/builtin_macro.rs | |||
@@ -108,7 +108,7 @@ fn stringify_expand( | |||
108 | 108 | ||
109 | let macro_content = { | 109 | let macro_content = { |
110 | let arg = loc.kind.arg(db).ok_or_else(|| mbe::ExpandError::UnexpectedToken)?; | 110 | let arg = loc.kind.arg(db).ok_or_else(|| mbe::ExpandError::UnexpectedToken)?; |
111 | let macro_args = arg.clone(); | 111 | let macro_args = arg; |
112 | let text = macro_args.text(); | 112 | let text = macro_args.text(); |
113 | let without_parens = TextUnit::of_char('(')..text.len() - TextUnit::of_char(')'); | 113 | let without_parens = TextUnit::of_char('(')..text.len() - TextUnit::of_char(')'); |
114 | text.slice(without_parens).to_string() | 114 | text.slice(without_parens).to_string() |
diff --git a/crates/ra_syntax/src/ast/edit.rs b/crates/ra_syntax/src/ast/edit.rs index 95bf9db14..ae5d63927 100644 --- a/crates/ra_syntax/src/ast/edit.rs +++ b/crates/ra_syntax/src/ast/edit.rs | |||
@@ -104,7 +104,7 @@ impl ast::ItemList { | |||
104 | } | 104 | } |
105 | }; | 105 | }; |
106 | 106 | ||
107 | let indent = leading_indent(self.syntax()).unwrap_or("".into()); | 107 | let indent = leading_indent(self.syntax()).unwrap_or_default(); |
108 | let ws = tokens::WsBuilder::new(&format!("\n{}", indent)); | 108 | let ws = tokens::WsBuilder::new(&format!("\n{}", indent)); |
109 | let to_insert = iter::once(ws.ws().into()); | 109 | let to_insert = iter::once(ws.ws().into()); |
110 | match existing_ws { | 110 | match existing_ws { |
@@ -133,7 +133,7 @@ impl ast::RecordFieldList { | |||
133 | let space = if is_multiline { | 133 | let space = if is_multiline { |
134 | ws = tokens::WsBuilder::new(&format!( | 134 | ws = tokens::WsBuilder::new(&format!( |
135 | "\n{} ", | 135 | "\n{} ", |
136 | leading_indent(self.syntax()).unwrap_or("".into()) | 136 | leading_indent(self.syntax()).unwrap_or_default() |
137 | )); | 137 | )); |
138 | ws.ws() | 138 | ws.ws() |
139 | } else { | 139 | } else { |