From f22aabc1360eb7e900a4495bc68f3302c7c49a7c Mon Sep 17 00:00:00 2001 From: kjeremy Date: Fri, 20 Dec 2019 09:43:30 -0500 Subject: Use unwrap_or_default --- crates/ra_syntax/src/ast/edit.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_syntax') 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 { } }; - 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 { -- cgit v1.2.3