later_operator 0.5.1

Parsable, storable, printable comparison operators, w/ optional serde support.
Documentation
/*!
# Later Operator: Errors
*/

use std::{
	borrow::Borrow,
	fmt,
};



#[derive(Debug, Clone, Copy, Eq, PartialEq)]
/// # Error.
pub struct Error;

impl AsRef<str> for Error {
	#[inline]
	fn as_ref(&self) -> &str { self.as_str() }
}

impl Borrow<str> for Error {
	#[inline]
	fn borrow(&self) -> &str { self.as_str() }
}

impl std::error::Error for Error {}

impl fmt::Display for Error {
	#[inline]
	fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
		<str as fmt::Display>::fmt(self.as_str(), f)
	}
}

impl Error {
	#[must_use]
	/// # As Str.
	///
	/// Return the error as a string slice.
	pub const fn as_str(self) -> &'static str { "unable to parse comparison operator" }
}