mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-25 03:27:56 +00:00
Merge pull request #2240 from Kixunil/patch-1
Call `reserve()` in `DeserializeSeed` example
This commit is contained in:
@@ -708,6 +708,11 @@ impl<T> DeserializeOwned for T where T: for<'de> Deserialize<'de> {}
|
||||
/// where
|
||||
/// A: SeqAccess<'de>,
|
||||
/// {
|
||||
/// // Decrease the number of reallocations if there are many elements
|
||||
/// if let Some(size_hint) = seq.size_hint() {
|
||||
/// self.0.reserve(size_hint);
|
||||
/// }
|
||||
///
|
||||
/// // Visit each element in the inner array and push it onto
|
||||
/// // the existing vector.
|
||||
/// while let Some(elem) = seq.next_element()? {
|
||||
|
||||
Reference in New Issue
Block a user