From c3a4e857e6f33cca1c271904cdc412fe74177e29 Mon Sep 17 00:00:00 2001 From: Dmitry Samoylov Date: Fri, 28 May 2021 18:21:16 +0700 Subject: [PATCH] Fix `transform_properties::Crop` deserialization https://github.com/serde-rs/serde/issues/1413#issuecomment-494892266 --- pipeline/src/node_properties/transform_properties.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pipeline/src/node_properties/transform_properties.rs b/pipeline/src/node_properties/transform_properties.rs index ca2e93a..59cba4f 100644 --- a/pipeline/src/node_properties/transform_properties.rs +++ b/pipeline/src/node_properties/transform_properties.rs @@ -1,5 +1,6 @@ use serde::{Deserialize, Serialize}; use serde_with::skip_serializing_none; +use std::borrow::Cow; use std::str::FromStr; #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] @@ -60,9 +61,9 @@ impl<'de> Deserialize<'de> for Crop { where D: serde::de::Deserializer<'de>, { - let s = <&str>::deserialize(deserializer)?; + let s = >::deserialize(deserializer)?; - Crop::from_str(s).map_err(serde::de::Error::custom) + Crop::from_str(&s).map_err(serde::de::Error::custom) } }