aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax/src')
-rw-r--r--crates/ra_syntax/src/ast.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_syntax/src/ast.rs b/crates/ra_syntax/src/ast.rs
index beef2c6e2..b0e0f8bf9 100644
--- a/crates/ra_syntax/src/ast.rs
+++ b/crates/ra_syntax/src/ast.rs
@@ -164,7 +164,7 @@ impl LetStmt {
164} 164}
165 165
166#[derive(Debug, Clone, PartialEq, Eq)] 166#[derive(Debug, Clone, PartialEq, Eq)]
167pub enum ElseBranchFlavor<'a> { 167pub enum ElseBranch<'a> {
168 Block(&'a Block), 168 Block(&'a Block),
169 IfExpr(&'a IfExpr), 169 IfExpr(&'a IfExpr),
170} 170}
@@ -173,12 +173,12 @@ impl IfExpr {
173 pub fn then_branch(&self) -> Option<&Block> { 173 pub fn then_branch(&self) -> Option<&Block> {
174 self.blocks().nth(0) 174 self.blocks().nth(0)
175 } 175 }
176 pub fn else_branch(&self) -> Option<ElseBranchFlavor> { 176 pub fn else_branch(&self) -> Option<ElseBranch> {
177 let res = match self.blocks().nth(1) { 177 let res = match self.blocks().nth(1) {
178 Some(block) => ElseBranchFlavor::Block(block), 178 Some(block) => ElseBranch::Block(block),
179 None => { 179 None => {
180 let elif: &IfExpr = child_opt(self)?; 180 let elif: &IfExpr = child_opt(self)?;
181 ElseBranchFlavor::IfExpr(elif) 181 ElseBranch::IfExpr(elif)
182 } 182 }
183 }; 183 };
184 Some(res) 184 Some(res)