Impl Error
for ParseStyleError
This commit is contained in:
parent
ac01fe7b82
commit
684d25e019
1 changed files with 9 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
||||||
use std::{io::{self, ErrorKind, Read, Write}, str};
|
use std::{error::Error, fmt, io::{self, ErrorKind, Read, Write}, str};
|
||||||
|
|
||||||
#[derive(Default, Clone, Copy)]
|
#[derive(Default, Clone, Copy)]
|
||||||
pub enum Style {
|
pub enum Style {
|
||||||
|
@ -12,6 +12,14 @@ pub enum Style {
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct ParseStyleError;
|
pub struct ParseStyleError;
|
||||||
|
|
||||||
|
impl fmt::Display for ParseStyleError {
|
||||||
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
|
write!(f, "{self:?}")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Error for ParseStyleError {}
|
||||||
|
|
||||||
impl str::FromStr for Style {
|
impl str::FromStr for Style {
|
||||||
type Err = ParseStyleError;
|
type Err = ParseStyleError;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue