liurenjie1024 commented on code in PR #21:
URL: https://github.com/apache/iceberg-rust/pull/21#discussion_r1284306589
##########
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:
I tried, but it seems that the generated code can't contains lifetime
parameter. The code duplication is not much, so I prefer to keep current
approach.
--
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]