style: use Self
in error enum impl
s
This commit is contained in:
@ -11,7 +11,7 @@ pub enum Error {
|
||||
impl Display for Error {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
Error::ServerInternal => write!(f, "internal server error"),
|
||||
Self::ServerInternal => write!(f, "internal server error"),
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -22,7 +22,7 @@ impl FromStr for Error {
|
||||
|
||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
Ok(match s {
|
||||
"internal server error" => Error::ServerInternal,
|
||||
"internal server error" => Self::ServerInternal,
|
||||
_ => return Err(()),
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user