]> git.proxmox.com Git - proxmox.git/commitdiff
notify: adapt to proxmox_schema changes, use const_format
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 19 Mar 2024 09:29:27 +0000 (10:29 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 19 Mar 2024 09:29:27 +0000 (10:29 +0100)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
proxmox-notify/Cargo.toml
proxmox-notify/src/matcher.rs

index 0a5be00589d64a235a625346a5a91f620359fc95..516880714742bb2e5ca7a69cf29de52cfcded2be 100644 (file)
@@ -9,6 +9,7 @@ exclude.workspace = true
 
 [dependencies]
 anyhow.workspace = true
+const_format.workspace = true
 handlebars = { workspace = true }
 lazy_static.workspace = true
 lettre = { workspace = true, optional = true }
index 3fdc8872424216013df7fe2689fb20670d061cd9..0f864450cc7030a5f9e8b47ef6765da6ca3c2e40 100644 (file)
@@ -1,15 +1,14 @@
-use regex::Regex;
 use std::collections::HashSet;
 use std::fmt;
 use std::fmt::Debug;
 use std::str::FromStr;
 
+use const_format::concatcp;
+use regex::Regex;
 use serde::{Deserialize, Serialize};
 
-use proxmox_schema::api_types::COMMENT_SCHEMA;
-use proxmox_schema::{
-    api, const_regex, ApiStringFormat, Schema, StringSchema, Updater, SAFE_ID_REGEX_STR,
-};
+use proxmox_schema::api_types::{COMMENT_SCHEMA, SAFE_ID_REGEX_STR};
+use proxmox_schema::{api, const_regex, ApiStringFormat, Schema, StringSchema, Updater};
 use proxmox_time::{parse_daily_duration, DailyDuration};
 
 use crate::schema::ENTITY_NAME_SCHEMA;
@@ -47,7 +46,7 @@ impl MatchModeOperator {
 }
 
 const_regex! {
-    pub MATCH_FIELD_ENTRY_REGEX = concat!(r"^(?:(exact|regex):)?(", SAFE_ID_REGEX_STR!(), r")=(.*)$");
+    pub MATCH_FIELD_ENTRY_REGEX = concatcp!(r"^(?:(exact|regex):)?(", SAFE_ID_REGEX_STR, r")=(.*)$");
 }
 
 pub const MATCH_FIELD_ENTRY_FORMAT: ApiStringFormat =