style: use Self in error enum impls

This commit is contained in:
2024-09-08 08:21:33 +02:00
parent ac97deb996
commit ac8d270df5
3 changed files with 8 additions and 8 deletions

View File

@ -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(()),
})
}