[pve-devel] [PATCH proxmox-perl-rs 06/11] notify: construct Notification via constructor

Lukas Wagner l.wagner at proxmox.com
Thu Aug 31 13:06:16 CEST 2023


This keeps us isolated from any further changes in the
proxmox_notify::Notification struct.

Signed-off-by: Lukas Wagner <l.wagner at proxmox.com>
---
 common/src/notify.rs | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/common/src/notify.rs b/common/src/notify.rs
index 9f44225..203acca 100644
--- a/common/src/notify.rs
+++ b/common/src/notify.rs
@@ -94,13 +94,7 @@ mod export {
         properties: Option<JSONValue>,
     ) -> Result<(), HttpError> {
         let config = this.config.lock().unwrap();
-
-        let notification = Notification {
-            severity,
-            title,
-            body,
-            properties,
-        };
+        let notification = Notification::new_templated(severity, title, body, properties);
 
         api::common::send(&config, channel, &notification)
     }
-- 
2.39.2






More information about the pve-devel mailing list