Optimize SessionPersister trait for better ownership semantics#962
Conversation
Pull Request Test Coverage Report for Build 17043170207Details
💛 - Coveralls |
|
The Format test in CI continues to not run and this appears to be related to #956 |
b2ecfc4 to
be5e590
Compare
It was a conflict with homebrew rust! Uninstalled it and now the format test works perfectly in CI! All checks passing |
arminsabouri
left a comment
There was a problem hiding this comment.
Overall great clean up! Just have a nit and a question. Thanks
- Change save_event signature from &Self::SessionEvent to Self::SessionEvent - Implement Arc optimization for InMemoryTestPersister - Update all trait implementers across CLI and FFI modules - Optimize session replay to eliminate duplicate conversions and sender clones - Remove 19 unnecessary clones from persist operations
be5e590 to
d7c1722
Compare
|
Hey @arminsabouri, thanks for the review! Fixed the destructuring nits, you were right, it's much cleaner with named bindings. Found a third occurrence following the same pattern and fixed that one too. All three now use RejectFatal(event, error) instead of the .0 and .1 access. About the mem::take suggestion , I gave it a try but SendSession doesn't implement Default (got E0277 when I tested). Since we're explicitly resetting to the Uninitialized state rather than some generic default, mem::replace actually makes more sense here anyway. It's clearer about the intent. Let me know if you spot anything else! All checks passing and ready for re-review. |
Part of #402 - Take arguments by reference where possible
Optimize SessionPersister trait for better ownership semantics
All tests passing