Is there a way to do
x = x.saturating_add(y);
like I would in zig?
x +|= y;
Is there a way to do
x = x.saturating_add(y);
like I would in zig?
x +|= y;
I'm not aware of a built-in way on the primitives, but num_traits
makes it easy enough. Or use Saturating
on nightly.