]> git.proxmox.com Git - proxmox-backup.git/commitdiff
use schema verify methods
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Thu, 30 Dec 2021 12:55:54 +0000 (13:55 +0100)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Thu, 30 Dec 2021 14:02:07 +0000 (15:02 +0100)
the old, deprecated ones only forward to these anyway.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
pbs-api-types/Cargo.toml
src/api2/types/mod.rs

index 9b1461a93e0a2ca59c682f3f7ad963de03fc547d..b40a707c79ad653c5c838eba345cf26581f3681b 100644 (file)
@@ -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" ] }
index 28bea293ab38eda86ca2c98ddebfcbda2fba0786..1911557f67f25bf35a69761ff1a96a0025620565 100644 (file)
@@ -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);