1
0
mirror of https://git.ngram.ca/OpenJam/rc-servers synced 2026-08-23 23:08:52 +00:00

Readability fixes for cargo clippy

This commit is contained in:
NG (Graham)
2025-09-03 22:33:26 -04:00
parent 9dcb12131b
commit 0e35aced01
77 changed files with 725 additions and 735 deletions

View File

@@ -25,26 +25,26 @@ async fn try_find_file(zip_path: std::path::PathBuf, id: u32) -> HttpResponse {
match e {
zip::result::ZipError::Io(e) => {
actix_web::HttpResponseBuilder::new(actix_web::http::StatusCode::INTERNAL_SERVER_ERROR)
.body(format!("zip io error: {}", e.to_string()))
.body(format!("zip io error: {}", e))
},
zip::result::ZipError::InvalidArchive(e) => {
actix_web::HttpResponseBuilder::new(actix_web::http::StatusCode::INTERNAL_SERVER_ERROR)
.body(format!("invalid zip file: {}", e.to_string()))
.body(format!("invalid zip file: {}", e))
},
zip::result::ZipError::UnsupportedArchive(e) => {
actix_web::HttpResponseBuilder::new(actix_web::http::StatusCode::INTERNAL_SERVER_ERROR)
.body(format!("unsupported zip file: {}", e.to_string()))
.body(format!("unsupported zip file: {}", e))
},
zip::result::ZipError::FileNotFound => {
actix_web::HttpResponseBuilder::new(actix_web::http::StatusCode::NOT_FOUND)
.body(format!("file not found in zip archive"))
.body("file not found in zip archive".to_string())
},
zip::result::ZipError::InvalidPassword => {
actix_web::HttpResponseBuilder::new(actix_web::http::StatusCode::INTERNAL_SERVER_ERROR)
.body(format!("invalid zip password"))
.body("invalid zip password".to_string())
},
_ => actix_web::HttpResponseBuilder::new(actix_web::http::StatusCode::INTERNAL_SERVER_ERROR)
.body(format!("unknown zip error")),
.body("unknown zip error".to_string()),
}
}
}

View File

@@ -8,4 +8,4 @@ pub mod favicon;
mod internal_auth;
pub use internal_auth::{IntercomAuth, IntercomOpError};
pub(self) const DEFAULT_IMAGE: &str = "default.jpg";
const DEFAULT_IMAGE: &str = "default.jpg";