Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

F/value range add sub helpers #107

Merged
merged 3 commits into from
Aug 17, 2023
Merged

Conversation

maurolacy
Copy link
Collaborator

@maurolacy maurolacy commented Aug 17, 2023

Add a couple of helpers to ValueRange for non-transactional addition and subtraction.

Names clash sometimes (but not always) with the std::ops::Add impl. That's unfortunate, but I couldn't think of better names. In any case, clashing can be avoided by using the fully qualified syntax for addition. (solved it by replacing the Add impl by a helper function)

Also adds a stock Display impl.

Copy link
Contributor

@jawoznia jawoznia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary in this PR but we could change prepare_add to something like reserve_add. This keyword well describes the purpose and is also used in the comment.

Also should this be merged to the main?

packages/sync/src/range.rs Show resolved Hide resolved
Replace by free helper function
@maurolacy
Copy link
Collaborator Author

Not necessary in this PR but we could change prepare_add to something like reserve_add. This keyword well describes the purpose and is also used in the comment.

I would stick to prepare_add for now.

@maurolacy maurolacy merged commit ad8f776 into main Aug 17, 2023
2 checks passed
@maurolacy maurolacy deleted the f/value-range-add-sub-helpers branch August 17, 2023 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants