You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm quite new to Rust so excuse me if this makes no sense, but would it be possible to make all the combined parsers (e.g. Choice) implement the Clone trait?
The text was updated successfully, but these errors were encountered:
They should all implemented Clone though it appears I had forgotten to add it to Choice and AndThen so thanks for opening an issue!
Remember that the parsers requires that all inner parsers also needs to be cloneable (for them to implement Clone themselves) which is not always possible, usually because of satisfy(|c| ...) as closures do not implement clone. If you need to use a parser multiple time in a function you can wrap it in a closure and call it in every position it is needed instead.
let parser = my_long_parser;
(parser, ..., parser)
let parser = || my_long_parser;
(parser(), ..., parser())
(If you'd like I can push a new beta version to cargo though I will otherwise hold of until a larger/a few more changes comes through).
I'm quite new to Rust so excuse me if this makes no sense, but would it be possible to make all the combined parsers (e.g.
Choice
) implement theClone
trait?The text was updated successfully, but these errors were encountered: