mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-14 08:12:24 +00:00
code cleanup
This commit is contained in:
@@ -4,7 +4,7 @@ use thiserror::Error;
|
|||||||
|
|
||||||
#[derive(Error, Debug)]
|
#[derive(Error, Debug)]
|
||||||
#[error("Invalid Depth header")]
|
#[error("Invalid Depth header")]
|
||||||
pub struct InvalidDepthHeader {}
|
pub struct InvalidDepthHeader;
|
||||||
|
|
||||||
impl ResponseError for InvalidDepthHeader {
|
impl ResponseError for InvalidDepthHeader {
|
||||||
fn status_code(&self) -> actix_web::http::StatusCode {
|
fn status_code(&self) -> actix_web::http::StatusCode {
|
||||||
@@ -27,7 +27,7 @@ impl TryFrom<&[u8]> for Depth {
|
|||||||
b"0" => Ok(Depth::Zero),
|
b"0" => Ok(Depth::Zero),
|
||||||
b"1" => Ok(Depth::One),
|
b"1" => Ok(Depth::One),
|
||||||
b"Infinity" | b"infinity" => Ok(Depth::Infinity),
|
b"Infinity" | b"infinity" => Ok(Depth::Infinity),
|
||||||
_ => Err(InvalidDepthHeader {}),
|
_ => Err(InvalidDepthHeader),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user