mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Add note about possible future improvement
Co-authored-by: David Tolnay <dtolnay@gmail.com>
This commit is contained in:
parent
84ef603c84
commit
2140d80a9d
@ -113,6 +113,8 @@ fn find_lang_feature_issue(feature: Symbol) -> Option<NonZeroU32> {
|
||||
}
|
||||
|
||||
const fn to_nonzero(n: Option<u32>) -> Option<NonZeroU32> {
|
||||
// Can be replaced with `n.and_then(NonZeroU32::new)` if that is ever usable
|
||||
// in const context. Requires https://github.com/rust-lang/rfcs/pull/2632.
|
||||
match n {
|
||||
None => None,
|
||||
Some(n) => NonZeroU32::new(n),
|
||||
|
Loading…
Reference in New Issue
Block a user