| Crates.io | saturating_add_assign |
| lib.rs | saturating_add_assign |
| version | 1.0.0 |
| created_at | 2024-11-21 11:27:40.649297+00 |
| updated_at | 2024-11-21 11:27:40.649297+00 |
| description | Convenience macro for AddAssign with saturating arithmetic. |
| homepage | |
| repository | https://github.com/kevinheavey/saturating_add_assign |
| max_upload_size | |
| id | 1456045 |
| size | 4,545 |
This crate contains the saturating_add_assign macro, which looks like this:
macro_rules! saturating_add_assign {
($i:expr, $v:expr) => {{
$i = $i.saturating_add($v)
}};
}
There is nothing else in here and there never will be. This crate exists because
the Agave repo uses this macro everywhere and
I wanted to rip it out without heavy dependencies.
You should probably only use this crate if you were already using the
original saturating_add_assign macro.
You should pin the version to 1.0.0 in your Cargo.toml file, because there isn't a clear reason why the four lines of code should ever change, and if there is a new release it could mean I got hacked.
[dependencies]
saturating_add_assign = "=1.0.0"