use std::{error::Error as StdError, fmt};
#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub enum StringError
{
FailedToString,
}
impl StdError for StringError {}
impl fmt::Display for StringError
{
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result
{
match *self {
StringError::FailedToString => write!(f, "failed to convert value to string"),
}
}
}
#[cfg(test)]
mod tests
{
use crate::errors::*;
#[test]
fn test_errors()
{
assert_eq!(format!("{}", StringError::FailedToString), "failed to convert value to string");
}
}