Ten0 commented on code in PR #1900:
URL: https://github.com/apache/avro/pull/1900#discussion_r1002680875
##########
lang/rust/avro/src/ser.rs:
##########
@@ -17,9 +17,24 @@
//! Logic for serde-compatible serialization.
use crate::{types::Value, Error};
+use ref_thread_local::{ref_thread_local, RefThreadLocal};
use serde::{ser, Serialize};
use std::{collections::HashMap, iter::once};
+ref_thread_local! {
+ /// A thread local that is used to decide how to serialize
+ /// a byte array into Avro `types::Value`.
+ ///
+ /// Depends on the fact that serde's serialization process is
single-threaded!
Review Comment:
How about adding this as field of the Serializer struct instead then to
avoid depending on this (and because it would probably be cleaner)?
I think that would be the idiomatic way to do it if it's possible.
--
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]