Repository navigation
Propagate OperationResult - #8433
Conversation
3ee2607 to
f3ce744
Compare
0404082 to
b61f902
Compare
f3ce744 to
b3c44da
Compare
11444ac to
337bfdf
Compare
b3c44da to
a560ee6
Compare
337bfdf to
7f74a36
Compare
a560ee6 to
b73a6db
Compare
7f74a36 to
a047ac3
Compare
916b88c to
bc00589
Compare
e5d91c8 to
c9c1cca
Compare
bc00589 to
90d7f83
Compare
c9c1cca to
c232229
Compare
90d7f83 to
58f0874
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (12)
📝 WalkthroughWalkthroughThis PR updates the Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Previously, our approach to I/O error handling was this: just read
&[u8]slices from mmaped areas. Not a singleResultor?in sight, just the core process living in the moment until being hit bySIGBUSin case if an I/O error occurs.Tho, the new universal I/O API can return read errors. This PR adds
OperationResultpropagation in some of the affected places. Particularly, this PR propagatesResultfromgeo_indexup to the nearest caller that returnsResult. For now, these always returnOkand neverErr. In subsequent PRs I plan to return errors fromgeo_index.Also, there is an additional commit to replace
&GeoHashwithGeoHash.It's a pure refactoring PR, no logic or behavior changes.
I didn't measured the performance impact.
Testimonials
Prompt:
Claude Response
Appendix:
Itertools::process_resultsToday I learned about this method. Suppose we have code operating on
Iterator<Item=T>and we want to adapt it to useIterator<Item=Result<T>>and returnResult. Instead of slapping extra.collect()and allocating intermediate vector like this:foo .get_some_iterator() + // bad: an extra allocation + .collect::<OperationResult<Vec<_>>>()? + .into_iterator() .map(…) .filter(…) .blahblah()we can use Itertools::process_results to avoid allocations:
foo .get_some_iterator() + // better + .process_results(|iter| { + iter .map(…) .filter(…) .blahblah() + })?PR Stack
This PR is stacked:
GeoHashinstead of&GeoHash#8443