Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'lib/smol_str/src/lib.rs')
-rw-r--r--lib/smol_str/src/lib.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/smol_str/src/lib.rs b/lib/smol_str/src/lib.rs
index 1583dfe077..9f99153f2a 100644
--- a/lib/smol_str/src/lib.rs
+++ b/lib/smol_str/src/lib.rs
@@ -1,11 +1,27 @@
+#![cfg_attr(not(feature = "std"), no_std)]
+
+#[cfg(not(feature = "std"))]
+extern crate core as std;
+
+#[cfg(not(feature = "std"))]
+extern crate alloc;
+
use std::{
borrow::Borrow,
cmp::{self, Ordering},
fmt, hash, iter,
ops::Deref,
+};
+
+#[cfg(not(feature = "std"))]
+use alloc::{
+ string::{String, ToString},
sync::Arc,
};
+#[cfg(feature = "std")]
+use std::sync::Arc;
+
/// A `SmolStr` is a string type that has the following properties:
///
/// * `size_of::<SmolStr>() == size_of::<String>()`