num-traits icon indicating copy to clipboard operation
num-traits copied to clipboard

Officially deprecate `Saturating`

Open benluelo opened this issue 3 years ago • 2 comments

The Saturating trait was deprecated here: https://github.com/rust-num/num-traits/commit/86c31265f582d98ca58ff494567f1bbaf6aa4b5b, but not officially (i.e. no #[deprecated, reason = "..."] attribute). Is there a reason for this? Would it be possible to do this?

benluelo avatar Jan 29 '23 04:01 benluelo

Possibly related to https://github.com/rust-num/num-traits/issues/47, although I don't think that deprecating a trait is a breaking change

benluelo avatar Jan 29 '23 04:01 benluelo

It's unfortunately tied to the PrimInt trait, as mentioned in https://github.com/rust-num/num-traits/pull/165#issuecomment-622645129. For that reason, I think a "soft" deprecation is better so folks don't have to squash a warning they can't otherwise avoid. There's also no inherent disadvantage to using Saturating -- it's just not consistent with how we did Checked* and Wrapping* traits.

Deprecation is not a breaking change though, you're right about that.

cuviper avatar Feb 10 '23 01:02 cuviper