Use syntax's version of SyntaxElement

This commit is contained in:
DropDemBits 2023-07-16 16:21:49 -04:00
parent cc4e06f04b
commit 92422f7488
No known key found for this signature in database
GPG Key ID: 7FE02A6C1EDFA075

View File

@ -3,13 +3,12 @@
use std::iter::{empty, successors};
use parser::{SyntaxKind, T};
use rowan::SyntaxElement;
use crate::{
algo::{self, neighbor},
ast::{self, edit::IndentLevel, make, HasGenericParams},
ted::{self, Position},
AstNode, AstToken, Direction,
AstNode, AstToken, Direction, SyntaxElement,
SyntaxKind::{ATTR, COMMENT, WHITESPACE},
SyntaxNode, SyntaxToken,
};
@ -577,7 +576,7 @@ pub fn add_item(&self, item: ast::AssocItem) {
None => (IndentLevel::single(), Position::last_child_of(self.syntax()), "\n"),
},
};
let elements: Vec<SyntaxElement<_>> = vec![
let elements: Vec<SyntaxElement> = vec![
make::tokens::whitespace(&format!("{whitespace}{indent}")).into(),
item.syntax().clone().into(),
];
@ -771,7 +770,7 @@ pub fn add_variant(&self, variant: ast::Variant) {
None => (IndentLevel::single(), Position::last_child_of(self.syntax())),
},
};
let elements: Vec<SyntaxElement<_>> = vec![
let elements: Vec<SyntaxElement> = vec![
make::tokens::whitespace(&format!("{}{indent}", "\n")).into(),
variant.syntax().clone().into(),
ast::make::token(T![,]).into(),