Skip to content

feat: Add methods for checked arithmetics to StakeHistoryEntry#394

Merged
joncinque merged 1 commit into
solana-program:mainfrom
vadorovsky:checked-arithmetics
May 20, 2026
Merged

feat: Add methods for checked arithmetics to StakeHistoryEntry#394
joncinque merged 1 commit into
solana-program:mainfrom
vadorovsky:checked-arithmetics

Conversation

@vadorovsky
Copy link
Copy Markdown
Contributor

The usage of existing std::ops::Add implementation triggers the arithmetic_side_effects clippy lint.

To allow addressing it, add the following methods to StakeHistoryEntry:

  • checked_add
  • wrapping_add
  • saturating_add

The usage of existing `std::ops::Add` implementation triggers the
`arithmetic_side_effects` clippy lint.

To allow addressing it, add the following methods to `StakeHistoryEntry`:

* `checked_add`
* `wrapping_add`
* `saturating_add`
Copy link
Copy Markdown
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

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

Makes sense to me! We might want to consider deprecating the normal ops::Add implementation then

@joncinque joncinque merged commit 4300e71 into solana-program:main May 20, 2026
25 checks passed
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