From 8a9edc7ecd0bf7ff7455822f837cd7de7baa05e3 Mon Sep 17 00:00:00 2001 From: Max Sharnoff Date: Fri, 27 Dec 2019 23:09:31 -0800 Subject: [PATCH] Change `__Nonexhaustive` variants to attribute (#353) --- src/error.rs | 4 +--- src/style/enums/attribute.rs | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/error.rs b/src/error.rs index 6ce4289..f439ea1 100644 --- a/src/error.rs +++ b/src/error.rs @@ -11,6 +11,7 @@ use crate::impl_from; pub type Result = std::result::Result; /// Wrapper for all errors that can occur in `crossterm`. +#[non_exhaustive] #[derive(Debug)] pub enum ErrorKind { IoError(io::Error), @@ -18,9 +19,6 @@ pub enum ErrorKind { Utf8Error(std::string::FromUtf8Error), ParseIntError(std::num::ParseIntError), ResizingTerminalFailure(String), - - #[doc(hidden)] - __Nonexhaustive, } impl std::error::Error for ErrorKind { diff --git a/src/style/enums/attribute.rs b/src/style/enums/attribute.rs index 3c60e38..1885118 100644 --- a/src/style/enums/attribute.rs +++ b/src/style/enums/attribute.rs @@ -56,6 +56,7 @@ use super::super::SetAttribute; /// println!("{}", "Negative text".negative()); /// ``` #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +#[non_exhaustive] #[derive(Copy, Clone, Debug, PartialEq, Eq, Ord, PartialOrd, Hash)] pub enum Attribute { /// Resets all the attributes. @@ -108,9 +109,6 @@ pub enum Attribute { NotFramedOrEncircled = 54, /// Turns off the `OverLined` attribute. NotOverLined = 55, - - #[doc(hidden)] - __Nonexhaustive, } impl Display for Attribute {