Xuanwo commented on code in PR #80:
URL: https://github.com/apache/iceberg-rust/pull/80#discussion_r1361762750
##########
crates/iceberg/src/spec/values.rs:
##########
@@ -995,7 +995,7 @@ mod tests {
assert_eq!(literal, expected_literal);
let mut writer = apache_avro::Writer::new(&schema, Vec::new());
- writer.append_ser(bytes).unwrap();
+ writer.append_ser(Into::<ByteBuf>::into(literal)).unwrap();
Review Comment:
Oh, I got it. `ByteBuf` provides it's own `ByteBuf::from` that may conflicts
with `From` trait.
Maybe we should provide a `Literal::to_vec()` instead? Users can utilize
`ByteBuf::from(Literal::to_vec())` to enhance semantic clarity.
Incidentally, since `Literal` already implements `Serialize`, it's easy to
misuse this API. Can we find a way to prevent this?
--
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]