fupio

Fupio はオンラインで共有する最も簡単な方法です 詳しく見る »

Fupio に参加
Lobsters: Newest Comments

Lobsters: Newest Comments

Yeah I am not sure what the actual best solution is, I personally like returning None when it reaches the bound, but I am also aware of good arguments against that. Throwing a panic in the case of a overflow would at least make the error a lot more visible.
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 I can see my argument be a bit inconsistent there, it is mostly because I think ranges should be able to be used as a guard for values, and it is in my opinion not clear that it is wrong to do that.
I might be writing a ACP up around this (or just adding to the one already existing about it), I personally think it is too late to change for the current RangeFrom type, but it might be doable for the new RangeFrom iterator since it is not yet used for de-sugaring.
https://lobste.rs/c/pt8idc

Comments