Unify naming of tuple fields

This commit is contained in:
Aleksey Kladov 2020-07-31 21:58:36 +02:00
parent 675e86becf
commit b9c6aa9ec9
5 changed files with 14 additions and 14 deletions

View file

@ -893,7 +893,7 @@ pub struct TupleExpr {
impl ast::AttrsOwner for TupleExpr {}
impl TupleExpr {
pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
pub fn exprs(&self) -> AstChildren<Expr> { support::children(&self.syntax) }
pub fn fields(&self) -> AstChildren<Expr> { support::children(&self.syntax) }
pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
@ -1210,7 +1210,7 @@ pub struct SlicePat {
}
impl SlicePat {
pub fn l_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['[']) }
pub fn args(&self) -> AstChildren<Pat> { support::children(&self.syntax) }
pub fn pats(&self) -> AstChildren<Pat> { support::children(&self.syntax) }
pub fn r_brack_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![']']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
@ -1219,7 +1219,7 @@ pub struct TuplePat {
}
impl TuplePat {
pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
pub fn args(&self) -> AstChildren<Pat> { support::children(&self.syntax) }
pub fn fields(&self) -> AstChildren<Pat> { support::children(&self.syntax) }
pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
@ -1229,7 +1229,7 @@ pub struct TupleStructPat {
impl TupleStructPat {
pub fn path(&self) -> Option<Path> { support::child(&self.syntax) }
pub fn l_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T!['(']) }
pub fn args(&self) -> AstChildren<Pat> { support::children(&self.syntax) }
pub fn fields(&self) -> AstChildren<Pat> { support::children(&self.syntax) }
pub fn r_paren_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![')']) }
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]

View file

@ -290,7 +290,7 @@ pub struct SlicePatComponents {
impl ast::SlicePat {
pub fn components(&self) -> SlicePatComponents {
let mut args = self.args().peekable();
let mut args = self.pats().peekable();
let prefix = args
.peeking_take_while(|p| match p {
ast::Pat::RestPat(_) => false,