martin-g commented on code in PR #327:
URL: https://github.com/apache/avro-rs/pull/327#discussion_r2472173082
##########
avro/src/lib.rs:
##########
@@ -1002,6 +1001,37 @@ pub use apache_avro_derive::*;
/// A convenience type alias for `Result`s with `Error`s.
pub type AvroResult<T> = Result<T, Error>;
+/// Set the maximum number of bytes that can be allocated when decoding data.
+///
+/// This function only changes the setting once. On subsequent calls the value
will stay the same
+/// as the first time it is called. It is automatically called on first
allocation and defaults to
+/// [`util::DEFAULT_MAX_ALLOCATION_BYTES`].
+///
+/// # Returns
+/// The configured maximum, which might be different from what the function
was called with if the
+/// value was already set before.
+#[deprecated(since = "0.21.0", note = "Please use util::max_allocation_bytes")]
+pub fn max_allocation_bytes(num_bytes: usize) -> usize {
+ util::max_allocation_bytes(num_bytes)
+}
+
+/// Set whether the serializer and deserializer should indicate to types that
the format is human-readable.
+///
+/// This function only changes the setting once. On subsequent calls the value
will stay the same
+/// as the first time it is called. It is automatically called on first
allocation and defaults to
+/// [`util::DEFAULT_SERDE_HUMAN_READABLE`].
+///
+/// *NOTE*: Changing this setting can change the output of [`from_value`] and
the
+/// accepted input of [`to_value`].
+///
+/// # Returns
+/// The configured human-readable value, which might be different from what
the function was called
+/// with if the value was already set before.
+#[deprecated(since = "0.21.0", note = "Please use
util::set_serde_human_readable")]
Review Comment:
```suggestion
#[deprecated(since = "0.21.0", note = "Please use
apache_avro::util::set_serde_human_readable")]
```
##########
avro/src/lib.rs:
##########
@@ -1002,6 +1001,37 @@ pub use apache_avro_derive::*;
/// A convenience type alias for `Result`s with `Error`s.
pub type AvroResult<T> = Result<T, Error>;
+/// Set the maximum number of bytes that can be allocated when decoding data.
+///
+/// This function only changes the setting once. On subsequent calls the value
will stay the same
+/// as the first time it is called. It is automatically called on first
allocation and defaults to
+/// [`util::DEFAULT_MAX_ALLOCATION_BYTES`].
+///
+/// # Returns
+/// The configured maximum, which might be different from what the function
was called with if the
+/// value was already set before.
+#[deprecated(since = "0.21.0", note = "Please use util::max_allocation_bytes")]
Review Comment:
```suggestion
#[deprecated(since = "0.21.0", note = "Please use
apache_avro::util::max_allocation_bytes")]
```
to be a bit more clear
--
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]