diff options
author | Seivan Heidari <[email protected]> | 2019-12-23 14:35:31 +0000 |
---|---|---|
committer | Seivan Heidari <[email protected]> | 2019-12-23 14:35:31 +0000 |
commit | b21d9337d9200e2cfdc90b386591c72c302dc03e (patch) | |
tree | f81f5c08f821115cee26fa4d3ceaae88c7807fd5 /crates/ra_syntax/src/ast/edit.rs | |
parent | 18a0937585b836ec5ed054b9ae48e0156ab6d9ef (diff) | |
parent | ce07a2daa9e53aa86a769f8641b14c2878444fbc (diff) |
Merge branch 'master' into feature/themes
Diffstat (limited to 'crates/ra_syntax/src/ast/edit.rs')
-rw-r--r-- | crates/ra_syntax/src/ast/edit.rs | 4 |
1 files changed, 2 insertions, 2 deletions
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 { |