-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using Fn
causes some lifetime issues.
#32
Comments
Have you found a workaroud yet? Try to use
|
@J-F-Liu unfortunately I don't have any elegant solution. I've been copy-pasting this kind of code for each call site where this kind of pattern is needed: (
indented() |
empty().map(|()| vec![])
).repeat(0..).map(
|lines| lines.into_iter().filter(
|line| line.len() > 0
).fold(
vec![],
|accum, line| accum.into_iter().chain(
line.into_iter().chain(vec![b'\n'].into_iter())
).collect()
)
).map(move |lines| {
*owned_parser*.parse(
&lines
).expect("subparse")
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm trying to generalise the approach found in the
whitespace
example.I think some changes may be needed in pom.
The following function is illegal:
The error is like this:
There is a problem:
map
takesFn
, notFnOnce
, so it's not possible to guarantee idempotenceThe text was updated successfully, but these errors were encountered: