pkstrings: impl fmt::Display for Error

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2021-11-13 21:45:30 +01:00
parent ce155c8a40
commit cc723f7684
Signed by: pep
GPG key ID: DEDA74AEECA9D0F2

View file

@ -91,6 +91,14 @@ pub enum Error {
InvalidCharacter,
}
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
match self {
Error::InvalidCharacter => write!(f, "Invalid character"),
}
}
}
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct PKString(String);