Should we have a saturating shift function?
This seems good. Should we have a saturating shift function? This isn't the first time we've needed this sort of thing.
Originally posted by @martinthomson in https://github.com/mozilla/neqo/pull/2294#discussion_r1938445973
Until https://doc.rust-lang.org/beta/std/num/struct.Saturating.html#method.rotate_left is stable, we might as well just copy the implementation.
Rotation isn't what we want. The code we'd need is here: https://doc.rust-lang.org/beta/src/core/num/saturating.rs.html#82 (commented out with a big question about what it means). Perhaps we can provide some useful input to that discussion.
I've commented on https://github.com/rust-lang/rust/issues/103440, which covers the language enhancements.
I think there is only check_blocked_streams where we'd use this. Not sure if it is worth it.