orium / rpds

Rust persistent data structures
Mozilla Public License 2.0
1.24k stars 58 forks source link

Make ptr_eq public #91

Open arthurprs opened 11 months ago

arthurprs commented 11 months ago

As discussed previously in #80. This should be a valid public api in persistent data-structures. It's already in im and in the stdlib.

It's valuable in a some cases as an identity check but also as a fast-path to avoid expensive set computations (intersection, union, etc.). In our application, we take great advantage of the latter.

Furthermore, persistent data structures in practice always(?) have efficient ptr_eq implementations, otherwise it would imply cloning isn't cheap or can't be done with a non-mut pointer. So it's likely to be future-proof even.

codecov[bot] commented 11 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (dc024b5) 96.29% compared to head (6ac8cbd) 96.29%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #91 +/- ## ======================================= Coverage 96.29% 96.29% ======================================= Files 11 11 Lines 1645 1645 ======================================= Hits 1584 1584 Misses 61 61 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.