Process for adding/requesting an impl for Rust's NonZero types

⚓ rust    📅 2025-06-10    👤 surdeus    👁️ 2      

surdeus

Hi All, I am finding myself needing to compare sizes std::num::NonZero<T> with T where T: ZeroablePrimitive, using <, >, =. But since they are not directly comparable, I have to NonZero::<T>::get() each time, and it is quite noisy.

What is the process for requesting or proposing the implementations PartialOrd<NonZero<T>> and PartialEq<NonZero<T>> for T (and the reverse) in the Rust std so that I may compare these values directly?

2 posts - 2 participants

Read full topic

🏷️ rust_feed