Fix or allow pedantic clippy lints

This commit is contained in:
Valentin Brandl 2023-07-27 10:37:16 +02:00
parent 29710d9263
commit 894afaa75d
3 changed files with 4 additions and 5 deletions

View File

@ -41,18 +41,16 @@ impl ResponseError for Error {
fn error_response(&self) -> HttpResponse {
let mut buf = Vec::new();
match self {
Error::BranchNotFound => {
if let Error::BranchNotFound = self {
templates::p404_no_master_html(&mut buf, VERSION_INFO, 0).unwrap();
HttpResponse::NotFound().content_type("text/html").body(buf)
}
_ => {
else {
templates::p500_html(&mut buf, VERSION_INFO, 0).unwrap();
HttpResponse::InternalServerError()
.content_type("text/html")
.body(buf)
}
}
}
}

View File

@ -282,6 +282,7 @@ where
}
pull(&path)?;
let (hoc, head, commits) = hoc(&service_url, &state.repos(), &state.cache(), branch)?;
#[allow(clippy::cast_precision_loss)]
let hoc_pretty = match NumberPrefix::decimal(hoc as f64) {
NumberPrefix::Standalone(hoc) => hoc.to_string(),
NumberPrefix::Prefixed(prefix, hoc) => format!("{hoc:.1}{prefix}"),

View File

@ -6,7 +6,7 @@ fn init() {
dotenvy::dotenv().ok();
openssl_probe::init_ssl_cert_env_vars();
telemetry::init_subscriber(telemetry::get_subscriber("hoc", "info"))
telemetry::init_subscriber(telemetry::get_subscriber("hoc", "info"));
}
#[actix_rt::main]