slawlor / ractor

Rust actor framework
MIT License
1.38k stars 69 forks source link

Add `map` for RactorErr/MessagingErr<T> #102

Closed jsgf closed 1 year ago

jsgf commented 1 year ago

Sometimes the embedded message is not needed and we need to normalize a number of errors from different sources, so add a map function which allows err.map(|_| ()).

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 80.00% and no project coverage change.

Comparison is base (668c46a) 79.17% compared to head (5783ec7) 79.17%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #102 +/- ## ======================================= Coverage 79.17% 79.17% ======================================= Files 49 49 Lines 8600 8625 +25 ======================================= + Hits 6809 6829 +20 - Misses 1791 1796 +5 ``` | [Impacted Files](https://app.codecov.io/gh/slawlor/ractor/pull/102?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Sean+Lawlor) | Coverage Δ | | |---|---|---| | [ractor/src/lib.rs](https://app.codecov.io/gh/slawlor/ractor/pull/102?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Sean+Lawlor#diff-cmFjdG9yL3NyYy9saWIucnM=) | `82.35% <70.00%> (-3.02%)` | :arrow_down: | | [ractor/src/actor/errors.rs](https://app.codecov.io/gh/slawlor/ractor/pull/102?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Sean+Lawlor#diff-cmFjdG9yL3NyYy9hY3Rvci9lcnJvcnMucnM=) | `64.51% <77.77%> (+2.25%)` | :arrow_up: | | [ractor/src/actor/tests/mod.rs](https://app.codecov.io/gh/slawlor/ractor/pull/102?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Sean+Lawlor#diff-cmFjdG9yL3NyYy9hY3Rvci90ZXN0cy9tb2QucnM=) | `93.96% <100.00%> (+0.06%)` | :arrow_up: | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/slawlor/ractor/pull/102/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Sean+Lawlor)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.