-
-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial changes to drop default serde dependency (#255)
- Loading branch information
1 parent
0f775e9
commit b9d58c2
Showing
29 changed files
with
1,157 additions
and
525 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
use std::{error, fmt, result}; | ||
|
||
use super::Content; | ||
|
||
pub type Result<T> = result::Result<T, Error>; | ||
|
||
#[derive(Debug)] | ||
pub enum Error { | ||
InvalidStructField(Content), | ||
FailedParsingYaml, | ||
UnexpectedDataType, | ||
MissingField, | ||
UnsupportedDataType, | ||
} | ||
|
||
impl fmt::Display for Error { | ||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | ||
match self { | ||
Self::InvalidStructField(content) => write!(f, "Invalid struct field: {:?}", content), | ||
Self::FailedParsingYaml => f.write_str("Failed parsing the provided YAML text"), | ||
Self::UnexpectedDataType => { | ||
f.write_str("The present data type wasn't what was expected") | ||
} | ||
Self::MissingField => f.write_str("A required field was missing"), | ||
Self::UnsupportedDataType => f.write_str("Failed converting an unsupported data type"), | ||
} | ||
} | ||
} | ||
|
||
impl error::Error for Error {} |
Oops, something went wrong.