(&mut self, when: Expr, then: Expr)
| 46 | } |
| 47 | } |
| 48 | pub fn when(&mut self, when: Expr, then: Expr) -> CaseBuilder { |
| 49 | self.when_expr.push(when); |
| 50 | self.then_expr.push(then); |
| 51 | CaseBuilder { |
| 52 | expr: self.expr.clone(), |
| 53 | when_expr: self.when_expr.clone(), |
| 54 | then_expr: self.then_expr.clone(), |
| 55 | else_expr: self.else_expr.clone(), |
| 56 | } |
| 57 | } |
| 58 | pub fn otherwise(&mut self, else_expr: Expr) -> Result<Expr> { |
| 59 | self.else_expr = Some(Box::new(else_expr)); |
| 60 | self.build() |