From 7f6c169b2563911b89aa4ed11ee92a8e3be26ee6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Thu, 30 Dec 2021 13:55:54 +0100 Subject: [PATCH] use schema verify methods MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit the old, deprecated ones only forward to these anyway. Signed-off-by: Fabian Grünbichler --- pbs-api-types/Cargo.toml | 2 +- src/api2/types/mod.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pbs-api-types/Cargo.toml b/pbs-api-types/Cargo.toml index 9b1461a9..b40a707c 100644 --- a/pbs-api-types/Cargo.toml +++ b/pbs-api-types/Cargo.toml @@ -14,7 +14,7 @@ regex = "1.2" serde = { version = "1.0", features = ["derive"] } proxmox-lang = "1.0.0" -proxmox-schema = { version = "1.0.1", features = [ "api-macro" ] } +proxmox-schema = { version = "1.1", features = [ "api-macro" ] } proxmox-serde = "0.1" proxmox-time = "1.1.1" proxmox-uuid = { version = "1.0.0", features = [ "serde" ] } diff --git a/src/api2/types/mod.rs b/src/api2/types/mod.rs index 28bea293..1911557f 100644 --- a/src/api2/types/mod.rs +++ b/src/api2/types/mod.rs @@ -39,7 +39,7 @@ fn test_cert_fingerprint_schema() -> Result<(), anyhow::Error> { ]; for fingerprint in invalid_fingerprints.iter() { - if parse_simple_value(fingerprint, &schema).is_ok() { + if schema.parse_simple_value(fingerprint).is_ok() { bail!("test fingerprint '{}' failed - got Ok() while exception an error.", fingerprint); } } @@ -50,7 +50,7 @@ fn test_cert_fingerprint_schema() -> Result<(), anyhow::Error> { ]; for fingerprint in valid_fingerprints.iter() { - let v = match parse_simple_value(fingerprint, &schema) { + let v = match schema.parse_simple_value(fingerprint) { Ok(v) => v, Err(err) => { bail!("unable to parse fingerprint '{}' - {}", fingerprint, err); @@ -83,7 +83,7 @@ fn test_proxmox_user_id_schema() -> Result<(), anyhow::Error> { ]; for name in invalid_user_ids.iter() { - if parse_simple_value(name, &Userid::API_SCHEMA).is_ok() { + if Userid::API_SCHEMA.parse_simple_value(name).is_ok() { bail!("test userid '{}' failed - got Ok() while exception an error.", name); } } @@ -97,7 +97,7 @@ fn test_proxmox_user_id_schema() -> Result<(), anyhow::Error> { ]; for name in valid_user_ids.iter() { - let v = match parse_simple_value(name, &Userid::API_SCHEMA) { + let v = match Userid::API_SCHEMA.parse_simple_value(name) { Ok(v) => v, Err(err) => { bail!("unable to parse userid '{}' - {}", name, err);