Generate only minimal set of ineresting tokens

This commit is contained in:
Aleksey Kladov 2020-04-10 15:53:09 +02:00
parent 8d71a6bf0c
commit 4560fe2abf
8 changed files with 61 additions and 1306 deletions

View file

@ -189,15 +189,15 @@ impl ast::RecordFieldList {
impl ast::TypeParam {
#[must_use]
pub fn remove_bounds(&self) -> ast::TypeParam {
let colon = match self.colon() {
let colon = match self.colon_token() {
Some(it) => it,
None => return self.clone(),
};
let end = match self.type_bound_list() {
Some(it) => it.syntax().clone().into(),
None => colon.syntax().clone().into(),
None => colon.clone().into(),
};
self.replace_children(colon.syntax().clone().into()..=end, iter::empty())
self.replace_children(colon.into()..=end, iter::empty())
}
}