From 214c251e41a7583397cc5939b9447b89752ee323 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Sat, 4 Dec 2021 15:13:43 -0500 Subject: [PATCH] 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. --- crates/caret/src/lib.rs | 24 ------------------------ doc/semver_status.md | 3 +++ 2 files changed, 3 insertions(+), 24 deletions(-) diff --git a/crates/caret/src/lib.rs b/crates/caret/src/lib.rs index 09b0f62f3..c3499224d 100644 --- a/crates/caret/src/lib.rs +++ b/crates/caret/src/lib.rs @@ -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 diff --git a/doc/semver_status.md b/doc/semver_status.md index 83a271663..a8f42d3d6 100644 --- a/doc/semver_status.md +++ b/doc/semver_status.md @@ -29,3 +29,6 @@ arti-client: MODIFIED tor-units: MODIFIED (Eq,PartialEq for BoundedInt32) + +caret: BREAKING + (Removed unused-but-exported Error type.)