Skip to content

Commit

Permalink
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions minicbor-serde/src/ser.rs
Original file line number Diff line number Diff line change
@@ -5,6 +5,9 @@ use serde::ser::{SerializeMap, SerializeStruct, SerializeStructVariant, Serializ

use crate::error::EncodeError;

#[cfg(feature = "alloc")]
use alloc::vec::Vec;

/// Serialise a type implementing [`serde::Serialize`] and return the encoded byte vector.
#[cfg(feature = "alloc")]
pub fn to_vec<T: Serialize>(val: T) -> Result<Vec<u8>, EncodeError<core::convert::Infallible>> {

0 comments on commit 33ee9bd

Please sign in to comment.