diff --git a/src/error.rs b/src/error.rs index 0f71446..4274a30 100644 --- a/src/error.rs +++ b/src/error.rs @@ -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) } - } } } diff --git a/src/lib.rs b/src/lib.rs index 0884d6e..709fd02 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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}"), diff --git a/src/main.rs b/src/main.rs index b72aa5e..89f4201 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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]