i5-add-tests (part 3) #9

Merged
kemitix merged 28 commits from i5-add-tests into main 2023-07-29 20:36:04 +01:00
Showing only changes of commit 9cb02f6790 - Show all commits

View file

@ -1,8 +1,8 @@
use std::{fmt::Display, str::Utf8Error, string::FromUtf8Error}; use std::{str::Utf8Error, string::FromUtf8Error};
#[derive(Debug)] #[derive(Debug)]
pub struct Error { pub struct Error {
details: String, pub details: String,
} }
impl Error { impl Error {
pub fn message(details: &str) -> Self { pub fn message(details: &str) -> Self {
@ -11,11 +11,6 @@ impl Error {
} }
} }
} }
impl Display for Error {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(self.details.to_string().as_str())
}
}
impl From<Utf8Error> for Error { impl From<Utf8Error> for Error {
fn from(value: Utf8Error) -> Self { fn from(value: Utf8Error) -> Self {
Self { Self {