From 3c34ef55732b64f4512ae81a8be522f58c9813f0 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Tue, 14 Jan 2025 10:26:05 +0100 Subject: [PATCH] section-config: use builder pattern for ObjectSchema To prepare for a breaking change in proxmox-schema. Since new fields in the schema constitute a breaking change, using the builder methods will let this compile later as well. Signed-off-by: Wolfgang Bumiller --- proxmox-section-config/src/lib.rs | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/proxmox-section-config/src/lib.rs b/proxmox-section-config/src/lib.rs index 351f53bd..836f77bd 100644 --- a/proxmox-section-config/src/lib.rs +++ b/proxmox-section-config/src/lib.rs @@ -1034,19 +1034,11 @@ fn test_section_config_with_additional_properties() { ), ]; - const USER_PROPERTIES: ObjectSchema = ObjectSchema { - description: "user properties", - properties: &PROPERTIES, - additional_properties: false, - default_key: None, - }; + const USER_PROPERTIES: ObjectSchema = ObjectSchema::new("user properties", &PROPERTIES); - const USER_PROPERTIES_WITH_ADDITIONAL: ObjectSchema = ObjectSchema { - description: "user properties with additional", - properties: &PROPERTIES, - additional_properties: true, - default_key: None, - }; + const USER_PROPERTIES_WITH_ADDITIONAL: ObjectSchema = + ObjectSchema::new("user properties with additional", &PROPERTIES) + .additional_properties(true); let plugin = SectionConfigPlugin::new( "user".to_string(), @@ -1104,12 +1096,7 @@ fn test_section_config_with_unknown_section_types() { ), ]; - const USER_PROPERTIES: ObjectSchema = ObjectSchema { - description: "user properties", - properties: &PROPERTIES, - additional_properties: false, - default_key: None, - }; + const USER_PROPERTIES: ObjectSchema = ObjectSchema::new("user properties", &PROPERTIES); let plugin = SectionConfigPlugin::new( "user".to_string(),