Add note about possible future improvement

Co-authored-by: David Tolnay <dtolnay@gmail.com>
This commit is contained in:
Mara Bos 2020-10-01 17:32:23 +02:00 committed by GitHub
parent 84ef603c84
commit 2140d80a9d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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),