*: Format with rustfmt (#2188)

Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
This commit is contained in:
Max Inden
2021-08-11 13:12:12 +02:00
committed by GitHub
parent 008561283e
commit f701b24ec0
171 changed files with 10051 additions and 7193 deletions

View File

@ -27,16 +27,22 @@ use std::fmt;
#[derive(Debug)]
pub struct DecodingError {
msg: String,
source: Option<Box<dyn Error + Send + Sync>>
source: Option<Box<dyn Error + Send + Sync>>,
}
impl DecodingError {
pub(crate) fn new<S: ToString>(msg: S) -> Self {
Self { msg: msg.to_string(), source: None }
Self {
msg: msg.to_string(),
source: None,
}
}
pub(crate) fn source(self, source: impl Error + Send + Sync + 'static) -> Self {
Self { source: Some(Box::new(source)), .. self }
Self {
source: Some(Box::new(source)),
..self
}
}
}
@ -56,17 +62,23 @@ impl Error for DecodingError {
#[derive(Debug)]
pub struct SigningError {
msg: String,
source: Option<Box<dyn Error + Send + Sync>>
source: Option<Box<dyn Error + Send + Sync>>,
}
/// An error during encoding of key material.
impl SigningError {
pub(crate) fn new<S: ToString>(msg: S) -> Self {
Self { msg: msg.to_string(), source: None }
Self {
msg: msg.to_string(),
source: None,
}
}
pub(crate) fn source(self, source: impl Error + Send + Sync + 'static) -> Self {
Self { source: Some(Box::new(source)), .. self }
Self {
source: Some(Box::new(source)),
..self
}
}
}
@ -81,4 +93,3 @@ impl Error for SigningError {
self.source.as_ref().map(|s| &**s as &dyn Error)
}
}