Add non_exhaustive attrs.
This commit is contained in:
parent
e18d71dedc
commit
60df9e0d38
@ -2,12 +2,11 @@ use core::future::Future;
|
|||||||
|
|
||||||
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
||||||
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
|
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
|
||||||
|
#[non_exhaustive]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
Failed,
|
Failed,
|
||||||
AddressMisaligned,
|
AddressMisaligned,
|
||||||
BufferMisaligned,
|
BufferMisaligned,
|
||||||
|
|
||||||
_NonExhaustive,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait Flash {
|
pub trait Flash {
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
/// Categories of errors that can occur.
|
/// Categories of errors that can occur.
|
||||||
///
|
|
||||||
/// This list is intended to grow over time and it is not recommended to
|
|
||||||
/// exhaustively match against it.
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||||
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
|
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
|
||||||
|
#[non_exhaustive]
|
||||||
pub enum Error {
|
pub enum Error {
|
||||||
/// An entity was not found, often a file.
|
/// An entity was not found, often a file.
|
||||||
NotFound,
|
NotFound,
|
||||||
@ -142,22 +140,3 @@ impl core::fmt::Display for Error {
|
|||||||
|
|
||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
impl std::error::Error for Error {}
|
impl std::error::Error for Error {}
|
||||||
|
|
||||||
/*
|
|
||||||
impl From<smoltcp::Error> for Error {
|
|
||||||
fn from(err: smoltcp::Error) -> Error {
|
|
||||||
match err {
|
|
||||||
smoltcp::Error::Exhausted => Error::Exhausted,
|
|
||||||
smoltcp::Error::Illegal => Error::Illegal,
|
|
||||||
smoltcp::Error::Unaddressable => Error::Unaddressable,
|
|
||||||
smoltcp::Error::Truncated => Error::Truncated,
|
|
||||||
smoltcp::Error::Checksum => Error::Checksum,
|
|
||||||
smoltcp::Error::Unrecognized => Error::Unrecognized,
|
|
||||||
smoltcp::Error::Fragmented => Error::Fragmented,
|
|
||||||
smoltcp::Error::Malformed => Error::Malformed,
|
|
||||||
smoltcp::Error::Dropped => Error::Dropped,
|
|
||||||
_ => Error::Other,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
Loading…
Reference in New Issue
Block a user