Skip to content

Re-use AllocVec #298

@BertrandBev

Description

@BertrandBev
let out = serialize_with_flavor(&message, AllocVec::new());

That method returns the inner Vec.
It should be great to be able to re-use an existing AllocVec to avoid repeated allocations when serializing a bunch of types. All we'd need is a

impl From<Vec<u8>> for AllocVec {
        fn from(vec: Vec<u8>) -> Self {
            Self(vec)
        }
    }

Would that make sense ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions