Deprecate and remove impl From<NonZeroU32> for Error
.
#455
Labels
enhancement
New feature or request
Milestone
The
From<NonZeroU32> for Error
implementation doesn't do any checking of its inputs; for example, it doesn't verify that an "internal" error code isn't being used, nor does it verify that any internal error code is actually a valid/known one.I propose:
pub const fn Error::new_custom(value: u16) -> Error
pub const fn Error::new_os(u32) -> Error
with range checking, as done in Enforce OS errors are in the allowed range. #441, though Enforce OS errors are in the allowed range. #441 doesn't make itpub
.impl From<NonZeroU32> for Error
as#[deprecated]
now.This way, internal errors will eventually only be able to be constructed from within the crate.
The text was updated successfully, but these errors were encountered: