Open DaniD3v opened 2 months ago
I just found out that this is already fixed on master.
We should probably backport the fix to 0.9
I agree, this should 'just work'. Monoid laws, etc. I'll look into backporting this over the next few days if it's a problem for you. That said, I'd recommend using 1.0 given that's where all the new dev work is happening.
I agree, this should 'just work'. Monoid laws, etc. I'll look into backporting this over the next few days if it's a problem for you. That said, I'd recommend using 1.0 given that's where all the new dev work is happening.
I already migrated to 1.0 yesterday. For the 0.9 users I have this little workaround.
if (parsers.len()) > 0 {
choice(parsers).boxed()
} else {
empty().not().boxed()
}
What do you think about just releasing a 0.10
version?
I think we're still quite far from 1.0
but the changes since 0.9
are already pretty significant.
I can imagine it's also pretty bothersome to maintain 2 branches all the time.
I'm happy to accept PRs to the 0.9 branch and perform releases for it. I wouldn't consider this to be a breaking change but a fix, too.
Having an empty choice is reasonable and useful. Consider having a
Vec<Option<impl Parser>>
and then using.into_iter().flatten()
.If you don't agree there should at least be an error message telling the user what went wrong.
here's the full backtrace: