]> Humopery - waterslager.git/commitdiff
Inline format args for clippy
authorfozzie <fozzie@humopery.space>
Fri, 15 Aug 2025 05:05:12 +0000 (00:05 -0500)
committerfozzie <fozzie@humopery.space>
Fri, 15 Aug 2025 05:05:12 +0000 (00:05 -0500)
src/handler.rs
src/main.rs

index a72be4d69e1b42e6b6e13254f5a29fb7ebc05ede..b284c7709a252c600b537cdb5d2b354be5671c5f 100644 (file)
@@ -47,7 +47,7 @@ pub struct CheckCanaryFormData{
 type CheckResponse = (StatusCode, Html<std::string::String>);
 
 fn error_response(code: StatusCode, error: String) -> CheckResponse {
-    error!("Error: {}", error);
+    error!("Error: {error}");
     (code, Html(ShowCheckFormTemplate{
        url: None,
        message: None,
@@ -69,8 +69,8 @@ pub async fn check_canary_result(
                              "URI missing from form data".to_string());
     };
     match headers.get("X-Forwarded-For") {
-       Some(remote_addr) => info!("IP {:?} ... Checking canary at {}", remote_addr, uri),
-       None => info!("IP unavailable ... Checking canary at {}", uri),
+       Some(remote_addr) => info!("IP {remote_addr:?} ... Checking canary at {uri}"),
+       None => info!("IP unavailable ... Checking canary at {uri}"),
     }
     match ureq::get(uri.clone()).call() {
        Ok(mut resp) =>
@@ -82,11 +82,11 @@ pub async fn check_canary_result(
                },
                Err(e) =>
                    error_response(StatusCode::BAD_REQUEST,
-                                  format!("Error decoding signed message to string: {}",e))
+                                  format!("Error decoding signed message to string: {e}"))
            },
        Err(e) =>
            error_response(StatusCode::INTERNAL_SERVER_ERROR,
-                          format!("Error reading message from upstream: {}",e))
+                          format!("Error reading message from upstream: {e}"))
     }
 }
 
index e538b0c64b08d9a63556b13863868c591e46e552..b20b336ab65f605e0070095a65891060deaa8e24 100644 (file)
@@ -59,8 +59,8 @@ async fn main() -> Result<(),Box<dyn std::error::Error>> {
        Ok(val) => val,
        Err(_) => "/".to_string()
     };
-    info!("App root is {}",app_root);
-    info!("Will listen on {}:{}", bind_host, bind_port);
+    info!("App root is {app_root}");
+    info!("Will listen on {bind_host}:{bind_port}");
 
     let certs = load_certs_from_fs().await.unwrap();
     info!("Loaded {} certs from trust/", certs.len());