From 2dad06cae3991d7de819f39cf7d63f8e2b519aca Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Thu, 8 Jun 2023 00:55:42 -0400 Subject: initial --- src/error.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/error.rs (limited to 'src/error.rs') diff --git a/src/error.rs b/src/error.rs new file mode 100644 index 0000000..399eb33 --- /dev/null +++ b/src/error.rs @@ -0,0 +1,17 @@ +use std::fmt::{Result, Display, Formatter}; + +pub enum PissError { + InvalidSuffix(String), + InvalidNumber(String), + NumberNotPositive +} + +impl Display for PissError { + fn fmt(&self, f: &mut Formatter<'_>) -> Result { + match self { + Self::InvalidSuffix(s) => write!(f, "I cannot piss the suffix {s:?}"), + Self::InvalidNumber(s) => write!(f, "I cannot piss the invalid number {s:?}"), + Self::NumberNotPositive => write!(f, "I cannot piss nonexistent memory") + } + } +} -- cgit v1.2.3-freya