mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
Unify naming of tuple fields
This commit is contained in:
parent
675e86becf
commit
b9c6aa9ec9
5 changed files with 14 additions and 14 deletions
|
@ -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)]
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue