-
-
Notifications
You must be signed in to change notification settings - Fork 187
Open
Labels
enhancementNew feature or requestNew feature or request
Description
It seems the only way I can really "collect" the values from a repeated
/ separated_by
combinator is via .collect
? My issue with is that basically requires a heap allocation by using Vec
or some alternative data structure that implements Collect
. Other patterns I would intuitively expect to work such as .fold
do not seem to work for some reason?
// ... more code
choice((
ident.clone().map(ParamExpr::NameRef),
label.clone().map(ParamExpr::FuncRef),
data_ref.clone().map(ParamExpr::DataRef),
u256_value.clone().map(|v| ParamExpr::Num(arena.alloc(v))),
))
.repeated()
// Can't do ?
.fold(BVec::with_capacity_in(16, arena), |mut exprs, expr| {
exprs.push(expr);
exprs
}),
The error message Rust gives me for why .fold
isn't working is very unreadable. Any ideas?
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request