From 8653fb277540dacb540027dafb7971294738fab0 Mon Sep 17 00:00:00 2001 From: Michal Kucharczyk <1728078+michalkucharczyk@users.noreply.github.com> Date: Fri, 5 Apr 2024 12:54:33 +0200 Subject: [PATCH] compilation fix for no-std Co-authored-by: Tobin C. Harding --- src/lib.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index feb3ac2..bd9223e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -48,6 +48,9 @@ pub extern crate serde; use alloc::borrow::Cow; use core::{fmt, str}; +#[cfg(all(feature = "alloc", not(feature = "std")))] +use alloc::{string::ToString, vec::Vec}; + /// We support a wide range of dependency versions for `rand` and `rand_core` and not /// all versions play nicely together. These re-exports fix that. #[cfg(all(feature = "rand", feature = "rand_core"))]