aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/ast/expr_extensions.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax/src/ast/expr_extensions.rs')
-rw-r--r--crates/ra_syntax/src/ast/expr_extensions.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/ra_syntax/src/ast/expr_extensions.rs b/crates/ra_syntax/src/ast/expr_extensions.rs
index 2e50a095c..77cceb382 100644
--- a/crates/ra_syntax/src/ast/expr_extensions.rs
+++ b/crates/ra_syntax/src/ast/expr_extensions.rs
@@ -30,7 +30,7 @@ pub enum ElseBranch {
30 30
31impl ast::IfExpr { 31impl ast::IfExpr {
32 pub fn then_branch(&self) -> Option<ast::BlockExpr> { 32 pub fn then_branch(&self) -> Option<ast::BlockExpr> {
33 self.blocks().nth(0) 33 self.blocks().next()
34 } 34 }
35 pub fn else_branch(&self) -> Option<ElseBranch> { 35 pub fn else_branch(&self) -> Option<ElseBranch> {
36 let res = match self.blocks().nth(1) { 36 let res = match self.blocks().nth(1) {
@@ -208,7 +208,7 @@ impl ast::BinExpr {
208 } 208 }
209 209
210 pub fn lhs(&self) -> Option<ast::Expr> { 210 pub fn lhs(&self) -> Option<ast::Expr> {
211 children(self).nth(0) 211 children(self).next()
212 } 212 }
213 213
214 pub fn rhs(&self) -> Option<ast::Expr> { 214 pub fn rhs(&self) -> Option<ast::Expr> {
@@ -271,7 +271,7 @@ impl ast::RangeExpr {
271 271
272impl ast::IndexExpr { 272impl ast::IndexExpr {
273 pub fn base(&self) -> Option<ast::Expr> { 273 pub fn base(&self) -> Option<ast::Expr> {
274 children(self).nth(0) 274 children(self).next()
275 } 275 }
276 pub fn index(&self) -> Option<ast::Expr> { 276 pub fn index(&self) -> Option<ast::Expr> {
277 children(self).nth(1) 277 children(self).nth(1)
@@ -287,7 +287,7 @@ impl ast::ArrayExpr {
287 pub fn kind(&self) -> ArrayExprKind { 287 pub fn kind(&self) -> ArrayExprKind {
288 if self.is_repeat() { 288 if self.is_repeat() {
289 ArrayExprKind::Repeat { 289 ArrayExprKind::Repeat {
290 initializer: children(self).nth(0), 290 initializer: children(self).next(),
291 repeat: children(self).nth(1), 291 repeat: children(self).nth(1),
292 } 292 }
293 } else { 293 } else {
@@ -328,10 +328,10 @@ impl ast::Literal {
328 } 328 }
329 329
330 pub fn kind(&self) -> LiteralKind { 330 pub fn kind(&self) -> LiteralKind {
331 const INT_SUFFIXES: [&'static str; 12] = [ 331 const INT_SUFFIXES: [&str; 12] = [
332 "u64", "u32", "u16", "u8", "usize", "isize", "i64", "i32", "i16", "i8", "u128", "i128", 332 "u64", "u32", "u16", "u8", "usize", "isize", "i64", "i32", "i16", "i8", "u128", "i128",
333 ]; 333 ];
334 const FLOAT_SUFFIXES: [&'static str; 2] = ["f32", "f64"]; 334 const FLOAT_SUFFIXES: [&str; 2] = ["f32", "f64"];
335 335
336 let token = self.token(); 336 let token = self.token();
337 337