When parsing becomes lazy, parse error will potentially happen in more places.
This propagates such errors to callers.
Details
- Reviewers
Alphare - Group Reviewers
hg-reviewers - Commits
- rHGed1583a845d2: dirstate-v2: Make more APIs fallible, returning Result
Diff Detail
- Repository
- rHG Mercurial
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
rust/hg-core/src/dirstate.rs | ||
---|---|---|
80–85 | Oh I hadn’t checked what rustfmt had done to this. Do you think it’d be better with separate type definitions for iterated items, in order to keep each definition on one line? | |
rust/hg-core/src/dirstate_tree/dirstate_map.rs | ||
518 | I don’t find exactly this. https://docs.rs/itertools/0.10.0/itertools/trait.Itertools.html#method.filter_map_ok is close but requires the callback to be infallible, whereas we want to potentially emit new errors while filtering/mapping. |
rust/hg-core/src/dirstate.rs | ||
---|---|---|
80–85 | I don't think it matters too much as far as I'm concerned, but some people might argue the opposite. They can send a patch ;) | |
rust/hg-core/src/dirstate_tree/status.rs | ||
121 | I wonder if the compiler will optimize the two loops somehow. But we can take a look at this in the profiling phase, later. |
Getting to 5 lines-high type declaration without Futures is a feat!