From 4378d44bcbd51afb4196fb2b7b4127748dc919d5 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Wed, 15 Jan 2025 10:56:48 +0100 Subject: [PATCH] notify: use builder for ObjectSchema Signed-off-by: Wolfgang Bumiller --- proxmox-notify/src/context/pbs.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/proxmox-notify/src/context/pbs.rs b/proxmox-notify/src/context/pbs.rs index cd117646..ded6cbc8 100644 --- a/proxmox-notify/src/context/pbs.rs +++ b/proxmox-notify/src/context/pbs.rs @@ -17,15 +17,14 @@ const PBS_NODE_CFG_FILENAME: &str = "/etc/proxmox-backup/node.cfg"; // it with the less restrictive schema should be enough for the purpose of getting the mail address. const DUMMY_ID_SCHEMA: Schema = StringSchema::new("dummy ID").min_length(3).schema(); const DUMMY_EMAIL_SCHEMA: Schema = StringSchema::new("dummy email").schema(); -const DUMMY_USER_SCHEMA: ObjectSchema = ObjectSchema { - description: "minimal PBS user", - properties: &[ +const DUMMY_USER_SCHEMA: ObjectSchema = ObjectSchema::new( + "minimal PBS user", + &[ ("userid", false, &DUMMY_ID_SCHEMA), ("email", true, &DUMMY_EMAIL_SCHEMA), ], - additional_properties: true, - default_key: None, -}; +) +.additional_properties(true); #[derive(Deserialize)] struct DummyPbsUser {