mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-30 04:56:25 +03:00
8b7479003b
feat: Add `bit_width` for unsigned `NonZero<T>` - Tracking issue: rust-lang/rust#142326 This pull request adds a method to the unsigned `NonZero<T>` that return the minimum number of bits required to represent a value. This can be achieved by using the `get` method and the methods added in rust-lang/rust#142328, but I think adding the `NonZero::bit_width` method is useful because it accomplishes the same thing a little more succinctly.