Xuanwo commented on code in PR #401: URL: https://github.com/apache/iceberg-rust/pull/401#discussion_r1635797291
########## crates/iceberg/src/spec/values.rs: ########## @@ -82,6 +91,46 @@ pub enum PrimitiveLiteral { Decimal(i128), } +fn serialize_ordered_float<S>( + float: &OrderedFloat<f32>, + serializer: S, +) -> std::result::Result<S::Ok, S::Error> +where + S: serde::Serializer, +{ + serializer.serialize_f32(float.into_inner()) +} + +fn deserialize_ordered_float<'de, D>( + deserializer: D, +) -> std::result::Result<OrderedFloat<f32>, D::Error> +where + D: serde::Deserializer<'de>, +{ + let float = f32::deserialize(deserializer)?; + Ok(OrderedFloat(float)) Review Comment: OrderedFloat should have its own serde support? -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org