From f18bb822214acd64dc0fc71d68411c0d55403bf1 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Sat, 23 Mar 2024 22:33:42 +0100 Subject: [PATCH] Fix CI --- src/string.rs | 4 +++- src/vec.rs | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/string.rs b/src/string.rs index 6eec1a3..f4293fb 100644 --- a/src/string.rs +++ b/src/string.rs @@ -1,13 +1,15 @@ //! A clone-on-write, small-string-optimized alternative to [`String`]. use alloc::borrow::Cow; -use alloc::string::String; use core::borrow::Borrow; use core::cmp::Ordering; use core::fmt::{self, Debug, Display, Formatter, Write}; use core::hash::{Hash, Hasher}; use core::ops::{Add, AddAssign, Deref}; +#[cfg(not(feature = "std"))] +use alloc::string::String; + use crate::dynamic::{DynamicVec, InlineVec}; /// Create a new [`EcoString`] from a format string. diff --git a/src/vec.rs b/src/vec.rs index 411fff4..e1ae948 100644 --- a/src/vec.rs +++ b/src/vec.rs @@ -1,6 +1,5 @@ //! A clone-on-write alternative to [`Vec`]. -use alloc::vec::Vec; use core::alloc::Layout; use core::borrow::Borrow; use core::cmp::Ordering; @@ -11,6 +10,9 @@ use core::mem; use core::ops::Deref; use core::ptr::{self, NonNull}; +#[cfg(not(feature = "std"))] +use alloc::vec::Vec; + use crate::sync::atomic::{self, AtomicUsize, Ordering::*}; /// Create a new [`EcoVec`] with the given elements.