Change __Nonexhaustive variants to attribute (#353)

This commit is contained in:
Max Sharnoff 2019-12-27 23:09:31 -08:00 committed by Timon
parent 43c977dc4f
commit 8a9edc7ecd
2 changed files with 2 additions and 6 deletions

View File

@ -11,6 +11,7 @@ use crate::impl_from;
pub type Result<T> = std::result::Result<T, ErrorKind>;
/// 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 {

View File

@ -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 {