mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-14 06:03:58 +00:00
Use unwrap_or_default
This commit is contained in:
parent
133b4063a6
commit
f22aabc136
1 changed files with 2 additions and 2 deletions
|
@ -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 ws = tokens::WsBuilder::new(&format!("\n{}", indent));
|
||||||
let to_insert = iter::once(ws.ws().into());
|
let to_insert = iter::once(ws.ws().into());
|
||||||
match existing_ws {
|
match existing_ws {
|
||||||
|
@ -133,7 +133,7 @@ impl ast::RecordFieldList {
|
||||||
let space = if is_multiline {
|
let space = if is_multiline {
|
||||||
ws = tokens::WsBuilder::new(&format!(
|
ws = tokens::WsBuilder::new(&format!(
|
||||||
"\n{} ",
|
"\n{} ",
|
||||||
leading_indent(self.syntax()).unwrap_or("".into())
|
leading_indent(self.syntax()).unwrap_or_default()
|
||||||
));
|
));
|
||||||
ws.ws()
|
ws.ws()
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue