There’s different kinds of integers. You could be referring to just the primitive integer types i.e. something like
u8, u16, etc. and
i8, i16, etc.. You could also be referring to more general cases of integers, including arbitrarily sized ones like e.g. from the
num-bigint crate. Well — okay — that one wouldn’t be
Bounded, but maybe you want to start counting at zero anyways?
To make your code compile as-is, you would require something like
AddAssign<T> + One + Bounded + Copy. If you don’t feel too bad about requiring a bit more but typing less, you could also resort to
NumAssign + Bounded + Copy.
If you want to support something like bigint (the linked example here as well as the following ones counts from zero), you could weaken
If you want to add something different from
1, you can use
from_str_radix or require extra
If you only want to use primitive integer types anyways and like simple trait bounds, maybe just use
PrimInt and rewrite the