Replies: 1 comment 3 replies
-
|
I think you just need to break up the and_then part? Instead of immediately passing the Result<String, ...> to the and_then, let bind the |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
In my program I uses vfs to read a file content and then parse it using lalrpop. The problem is that vfs returns a
Result<String, _>and the parse method of lalrpop takes a&str. Here the code sample:And the complete error:
Faultis a struct deriving Error that I use because vfs and lalrpop don't use same error types.I've looked into multiple stackoverflow similar questions but didn't succeed to apply the answers. So I come to you hoping you have a solution.
The sources of Fault struct if needed as it seems to come from it https://github.com/Gashmob/fil/blob/0bdecc4e87346d4a5b311509a4f30f11ce7a0ab9/src/fault/mod.rs
I have a temporary fix by replacing the last
map_errby (but it is not awesome and I loose error context):Beta Was this translation helpful? Give feedback.
All reactions