[pbs-devel] [PATCH proxmox 04/10] property_string: clippy: define bound once

Maximiliano Sandoval m.sandoval at proxmox.com
Wed Aug 7 09:43:50 CEST 2024


Fixes the clippy lint:

warning: bound is defined in more than one place
   --> proxmox-schema/src/property_string.rs:352:14
    |
352 | pub fn parse<T: ApiType>(value: &str) -> Result<T, Error>
    |              ^
353 | where
354 |     T: for<'de> Deserialize<'de>,
    |     ^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_bound_locations
    = note: `#[warn(clippy::multiple_bound_locations)]` on by default

Signed-off-by: Maximiliano Sandoval <m.sandoval at proxmox.com>
---
 proxmox-schema/src/property_string.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/proxmox-schema/src/property_string.rs b/proxmox-schema/src/property_string.rs
index 7dd60f76..7b5a4ed1 100644
--- a/proxmox-schema/src/property_string.rs
+++ b/proxmox-schema/src/property_string.rs
@@ -349,9 +349,9 @@ pub fn print<T: Serialize + ApiType>(value: &T) -> Result<String, Error> {
 }
 
 /// Deserialize a value from a property string.
-pub fn parse<T: ApiType>(value: &str) -> Result<T, Error>
+pub fn parse<T>(value: &str) -> Result<T, Error>
 where
-    T: for<'de> Deserialize<'de>,
+    T: for<'de> Deserialize<'de> + ApiType,
 {
     parse_with_schema(value, &T::API_SCHEMA)
 }
-- 
2.39.2





More information about the pbs-devel mailing list