/// Add a list of choices.
Add a list of choices.
Add a list of choices .
pub fn add_choices<I>(&self, ast: Spanned<I>) -> Result<Spanned<hir::Choices>>
    where
        I: IntoIterator<Item = &'ast ast::Expr>,
    {
        let ctx = TermContext::new(self.ctx, self.scope);
        let choices = ast
            .value
            .into_iter()
            .map(|ast| {
                let term = ctx.termify_expr(ast)?;
                ctx.term_to_choice(term)
            })
            .collect::<Vec<Result<_>>>()
            .into_iter()
            .collect::<Result<Vec<_>>>()?;
        Ok(Spanned::new(choices, ast.span))
    }
pub fn add_choices < I > ( & self , ast : Spanned < I > ) -> Result < Spanned < hir :: Choices > > where I : IntoIterator < Item = & ' ast ast :: Expr > , { let ctx = TermContext :: new ( self . ctx , self . scope ) ; let choices = ast . value . into_iter ( ) . map ( | ast | { let term = ctx . termify_expr ( ast ) ? ; ctx . term_to_choice ( term ) } ) . collect :: < Vec < Result < _ > > > ( ) . into_iter ( ) . collect :: < Result < Vec < _ > > > ( ) ? ; Ok ( Spanned :: new ( choices , ast . span ) ) }
Add a list of choices.
Add a list of choices .
&self
ast
Spanned<I>