fupio

Fupio çevrimiçi paylaşmanın en kolay yolu Daha fazla bilgi »

Fupio'ya katıl
Lobsters: Newest Comments

Lobsters: Newest Comments

Your canonical definition of the Step trait is also the reason why I dislike the saturation that NonZero<u*> does since It kinda breaks that S(x) != x, I think throwing a panic would be more reasonable.
Yeah 100% agreed, saturation makes no sense whatsoever. That is IMO the most blatant problem among the things you discuss. Do you know if there's an open issue for that?
The Step trait docs currently explicitly allow this: "If this would overflow the range of values supported by Self, this function is allowed to panic, wrap, or saturate. The suggested behavior is to panic when debug assertions are enabled, and to wrap or saturate otherwise." But IMO this should be changed, it is too surprising and inconsistent.
https://lobste.rs/c/6atqfs

Comments