Remove the unused "Error" type from caret.

This was a relic of the old, now-unused "caret_enum!" macro.
Removing it gets caret's coverage to 100%.

Yes, technically this is a semver breaker on caret.
This commit is contained in:
Nick Mathewson 2021-12-04 15:13:43 -05:00
parent 68d4070038
commit 214c251e41
2 changed files with 3 additions and 24 deletions

View File

@ -67,30 +67,6 @@
#![warn(clippy::unseparated_literal_suffix)]
#![deny(clippy::unwrap_used)]
/// An error produced from type derived from type. These errors can
/// only occur when trying to convert to a type made with caret_enum!
#[derive(Debug, Clone, PartialEq, Eq)]
#[non_exhaustive]
pub enum Error {
/// Tried to convert to an enumeration type from an integer that
/// didn't represent a member of that enumeration.
InvalidInteger,
/// Tried to convert to an enumeration type from a string that
/// didn't represent a member of that enumeration.
InvalidString,
}
impl std::fmt::Display for Error {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Error::InvalidInteger => write!(f, "Integer was not member of this enumeration"),
Error::InvalidString => write!(f, "String was not member of this enumeration"),
}
}
}
impl std::error::Error for Error {}
/// Declare an integer type with some named elements.
///
/// This macro declares a struct that wraps an integer

View File

@ -29,3 +29,6 @@ arti-client: MODIFIED
tor-units: MODIFIED
(Eq,PartialEq for BoundedInt32)
caret: BREAKING
(Removed unused-but-exported Error type.)