diff --git a/Changelog.md b/Changelog.md index 22ff7790..adf104cd 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,6 +1,10 @@ # Changelog +## [Unreleased] + +* Add `IDLBuilder.try_reserve_value_serializer_capacity()` to reserve capacity before serializing a large amount of data. + ## 2024-05-03 ### Candid 0.10.10 diff --git a/rust/candid/src/error.rs b/rust/candid/src/error.rs index 9caedf9b..f7f6d068 100644 --- a/rust/candid/src/error.rs +++ b/rust/candid/src/error.rs @@ -1,6 +1,7 @@ //! `candid::Result = Result>` use serde::{de, ser}; +use std::collections::TryReserveError; use std::{io, num::ParseIntError}; use thiserror::Error; @@ -17,6 +18,9 @@ pub enum Error { #[error("binary parser error: {}", .0.first().map_or_else(|| "io error".to_string(), |f| format!("{} at byte offset {}", f.message, f.pos/2)))] Binread(Vec