From: Wolfgang Bumiller Date: Tue, 19 Mar 2024 09:29:27 +0000 (+0100) Subject: notify: adapt to proxmox_schema changes, use const_format X-Git-Url: https://git.proxmox.com/?p=proxmox.git;a=commitdiff_plain;h=6f1d439f099d1e2f789a5a135f8d6c839c667775 notify: adapt to proxmox_schema changes, use const_format Signed-off-by: Wolfgang Bumiller --- diff --git a/proxmox-notify/Cargo.toml b/proxmox-notify/Cargo.toml index 0a5be005..51688071 100644 --- a/proxmox-notify/Cargo.toml +++ b/proxmox-notify/Cargo.toml @@ -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 } diff --git a/proxmox-notify/src/matcher.rs b/proxmox-notify/src/matcher.rs index 3fdc8872..0f864450 100644 --- a/proxmox-notify/src/matcher.rs +++ b/proxmox-notify/src/matcher.rs @@ -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 =