i5-add-tests (part 3) #9
1 changed files with 2 additions and 7 deletions
|
@ -1,8 +1,8 @@
|
|||
use std::{fmt::Display, str::Utf8Error, string::FromUtf8Error};
|
||||
use std::{str::Utf8Error, string::FromUtf8Error};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Error {
|
||||
details: String,
|
||||
pub details: String,
|
||||
}
|
||||
impl Error {
|
||||
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 {
|
||||
fn from(value: Utf8Error) -> Self {
|
||||
Self {
|
||||
|
|
Loading…
Add table
Reference in a new issue