>>801
i8で動かない原因はFromを使っているためなのでTryFromを使えばi8でも動く

use std::convert::TryFrom;
use std::ops::Rem;
use num::CheckedAdd;

fn fizzbuzz<T>() -> impl Iterator<Item=FizzBuzzResult<T>>
where T: Copy + PartialEq + CheckedAdd + Rem<Output=T> + TryFrom<usize>,
{
let [zero, one, three, five] = [0, 1, 3, 5]
.map(|n| T::try_from(n).ok().unwrap());
itertools::unfold(zero, move |n|
n.checked_add(&one).map(|new| {
*n = new;
match (new % three, new % five) {
(x, y) if x == zero && y == zero => FizzBuzzResult::FizzBuzz,
(x, _) if x == zero => FizzBuzzResult::Fizz,
(_, y) if y == zero => FizzBuzzResult::Buzz,
_ => FizzBuzzResult::Num(new),
}
})
)
}

fn main() {
for f in fizzbuzz::<i8>() {
println!("{f}");
}
}

ちゃんとi8の上限127で停止