[pbs-devel] [PATCH proxmox 1/2] tree-wide: format code using `cargo fmt`

Lukas Wagner l.wagner at proxmox.com
Tue Dec 5 13:31:14 CET 2023


Signed-off-by: Lukas Wagner <l.wagner at proxmox.com>
---
 proxmox-login/src/ticket.rs          |  4 ++--
 proxmox-notify/src/lib.rs            | 13 ++++++++++---
 proxmox-rest-server/src/formatter.rs |  7 +++++--
 3 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/proxmox-login/src/ticket.rs b/proxmox-login/src/ticket.rs
index b37952c..9543b70 100644
--- a/proxmox-login/src/ticket.rs
+++ b/proxmox-login/src/ticket.rs
@@ -240,12 +240,12 @@ impl Authentication {
     }
 }
 
-#[cfg(target_arch="wasm32")]
+#[cfg(target_arch = "wasm32")]
 fn epoch_i64() -> i64 {
     (js_sys::Date::now() / 1000.0) as i64
 }
 
-#[cfg(not(target_arch="wasm32"))]
+#[cfg(not(target_arch = "wasm32"))]
 fn epoch_i64() -> i64 {
     use std::time::{SystemTime, UNIX_EPOCH};
 
diff --git a/proxmox-notify/src/lib.rs b/proxmox-notify/src/lib.rs
index 1fb9623..3f97332 100644
--- a/proxmox-notify/src/lib.rs
+++ b/proxmox-notify/src/lib.rs
@@ -278,14 +278,21 @@ impl Config {
                     if let Some(obj) = value.as_object_mut() {
                         obj.insert("origin".to_string(), Value::String("builtin".into()));
                     } else {
-                        log::error!("section config entry is not an object. This should not happen");
+                        log::error!(
+                            "section config entry is not an object. This should not happen"
+                        );
                     }
                 } else {
                     // Entry is built-in, but it has been modified by the user.
                     if let Some(obj) = value.as_object_mut() {
-                        obj.insert("origin".to_string(), Value::String("modified-builtin".into()));
+                        obj.insert(
+                            "origin".to_string(),
+                            Value::String("modified-builtin".into()),
+                        );
                     } else {
-                        log::error!("section config entry is not an object. This should not happen");
+                        log::error!(
+                            "section config entry is not an object. This should not happen"
+                        );
                     }
                 }
             } else {
diff --git a/proxmox-rest-server/src/formatter.rs b/proxmox-rest-server/src/formatter.rs
index d19d680..793d6b1 100644
--- a/proxmox-rest-server/src/formatter.rs
+++ b/proxmox-rest-server/src/formatter.rs
@@ -223,7 +223,10 @@ impl OutputFormatter for ExtJsFormatter {
                     for (name, err) in param_err {
                         errors.insert(name, err.to_string());
                     }
-                    (String::from("parameter verification errors"), StatusCode::BAD_REQUEST)
+                    (
+                        String::from("parameter verification errors"),
+                        StatusCode::BAD_REQUEST,
+                    )
                 }
                 Err(err) => (err.to_string(), StatusCode::BAD_REQUEST),
             }
@@ -233,7 +236,7 @@ impl OutputFormatter for ExtJsFormatter {
             } else {
                 StatusCode::BAD_REQUEST
             };
-            (err.to_string(),  status)
+            (err.to_string(), status)
         };
 
         let result = json!({
-- 
2.39.2





More information about the pbs-devel mailing list