mirror of
https://github.com/fafhrd91/actix-web
synced 2025-08-31 00:50:20 +02:00
clippy warnings; fmt
This commit is contained in:
16
src/error.rs
16
src/error.rs
@@ -68,12 +68,7 @@ impl fmt::Debug for Error {
|
||||
if let Some(bt) = self.cause.backtrace() {
|
||||
write!(f, "{:?}\n\n{:?}", &self.cause, bt)
|
||||
} else {
|
||||
write!(
|
||||
f,
|
||||
"{:?}\n\n{:?}",
|
||||
&self.cause,
|
||||
self.backtrace.as_ref().unwrap()
|
||||
)
|
||||
write!(f, "{:?}\n\n{:?}", &self.cause, self.backtrace.as_ref().unwrap())
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -298,17 +293,16 @@ pub enum HttpRangeError {
|
||||
/// Returned if first-byte-pos of all of the byte-range-spec
|
||||
/// values is greater than the content size.
|
||||
/// See `https://github.com/golang/go/commit/aa9b3d7`
|
||||
#[fail(display = "First-byte-pos of all of the byte-range-spec values is greater than the content size")]
|
||||
#[fail(
|
||||
display = "First-byte-pos of all of the byte-range-spec values is greater than the content size"
|
||||
)]
|
||||
NoOverlap,
|
||||
}
|
||||
|
||||
/// Return `BadRequest` for `HttpRangeError`
|
||||
impl ResponseError for HttpRangeError {
|
||||
fn error_response(&self) -> HttpResponse {
|
||||
HttpResponse::with_body(
|
||||
StatusCode::BAD_REQUEST,
|
||||
"Invalid Range header provided",
|
||||
)
|
||||
HttpResponse::with_body(StatusCode::BAD_REQUEST, "Invalid Range header provided")
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user