martin-g commented on code in PR #139:
URL: https://github.com/apache/avro-rs/pull/139#discussion_r1978996469


##########
avro/src/de.rs:
##########
@@ -55,6 +55,11 @@ pub struct EnumDeserializer<'de> {
     input: &'de [(String, Value)],
 }
 
+struct UnionDeserializer<'de> {

Review Comment:
   Please add some Rustdoc.
   I know that the other structs here may not have docs, but this is one of the 
reasons why the SerDe functionality is not well maintained in Avro.
   - what is this struct / why is it needed
   - what are its field for
   - etc.



##########
avro/src/de.rs:
##########
@@ -230,6 +241,60 @@ impl<'de> de::VariantAccess<'de> for EnumDeserializer<'de> 
{
     }
 }
 
+impl<'de> de::EnumAccess<'de> for UnionDeserializer<'de> {
+    type Error = Error;
+    type Variant = Self;

Review Comment:
   I am not sure this type is helpful here.
   It usage below (Self::Variant) makes it more confusing.
   Can we use just `Self` ?!



##########
avro/src/ser_direct.rs:
##########
@@ -0,0 +1,2032 @@
+use std::{borrow::Cow, io::Write};
+
+use serde::ser;
+
+use crate::{
+    encode::{encode_int, encode_long},
+    error::Error,
+    schema::{Name, NamesRef, Namespace, RecordSchema, Schema},
+};
+
+const RECORD_FIELD_INIT_BUFFER_SIZE: usize = 64;
+const COLLECTION_SERIALIZER_ITEM_LIMIT: usize = 1024;
+const COLLECTION_SERIALIZER_DEFAULT_INIT_ITEM_CAPACITY: usize = 32;
+const SINGLE_VALUE_INIT_BUFFER_SIZE: usize = 128;
+
+pub struct DirectSerializeSeq<'a, 's, W: Write> {

Review Comment:
   Rustdoc please for all public items!
   With as much as possible details because even the current ser.rs and de.rs 
are hard to maintain.
   



-- 
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]

Reply via email to