You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice if there was some way to express things like this.
// There is `ZeroablePrimitive` but that is an unstable and internal trait.structExample<U:PrimInt>{nz:NonZero<U>,val:U}
I don't see anything really in the num_traits for working with NonZero or knowing that the type can be made into one.
// I ended up doing something like this:structExample<U:PrimInt + NonZeroType>{nz:U::NonZero,val:U}// However this leaves a lot traits and other features of NonZero not available// short of adding more to this traitpubtraitNonZeroType:PrimInt{typeNonZero;fnnew(self) -> Option<Self::NonZero>;unsafefnnew_unchecked(self) -> Self::NonZero;fnget(nz:Self::NonZero) -> Self;}
The text was updated successfully, but these errors were encountered:
It would be nice if there was some way to express things like this.
I don't see anything really in the
num_traits
for working with NonZero or knowing that the type can be made into one.The text was updated successfully, but these errors were encountered: