JanKaul commented on code in PR #21:
URL: https://github.com/apache/iceberg-rust/pull/21#discussion_r1284292619


##########
crates/iceberg/src/spec/datatypes.rs:
##########
@@ -90,6 +92,26 @@ pub enum PrimitiveType {
     Binary,
 }
 
+impl Serialize for Type {
+    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
+    where
+        S: Serializer,
+    {
+        let type_serde = _serde::SerdeType::from(self);
+        type_serde.serialize(serializer)
+    }
+}
+
+impl<'de> Deserialize<'de> for Type {
+    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
+    where
+        D: Deserializer<'de>,
+    {
+        let type_serde = _serde::SerdeType::deserialize(deserializer)?;
+        Ok(Type::from(type_serde))
+    }
+}
+

Review Comment:
   Couldn't we simplify this with:
   
   ```rust
   #[serde(from = "_serde::SerdeType", into = "_serde::SerdeType")]
   pub enum Type {
   ...
   }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to