mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Be consistent about token accesors
This commit is contained in:
parent
e6d22187a6
commit
2bfb65db93
14 changed files with 36 additions and 114 deletions
|
@ -33,9 +33,9 @@ impl ast::FnDef {
|
|||
let mut to_insert: ArrayVec<[SyntaxElement; 2]> = ArrayVec::new();
|
||||
let old_body_or_semi: SyntaxElement = if let Some(old_body) = self.body() {
|
||||
old_body.syntax().clone().into()
|
||||
} else if let Some(semi) = self.semicolon_token() {
|
||||
} else if let Some(semi) = self.semi_token() {
|
||||
to_insert.push(make::tokens::single_space().into());
|
||||
semi.into()
|
||||
semi.syntax.clone().into()
|
||||
} else {
|
||||
to_insert.push(make::tokens::single_space().into());
|
||||
to_insert.push(body.syntax().clone().into());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue