From ba4a56c4a911fa8dabcf7a374f4611dd2677a97f Mon Sep 17 00:00:00 2001 From: Nick Spinale Date: Tue, 18 Mar 2025 02:02:00 -0700 Subject: [PATCH] Use #![no_std] --- Cargo.toml | 2 +- src/lib.rs | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4e4b5ac..22e6187 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,4 +13,4 @@ keywords = ["memory-management"] [dependencies] log = "0.4" -nonmax = "0.5" +nonmax = { version = "0.5", default-features = false } diff --git a/src/lib.rs b/src/lib.rs index 98ab025..e979839 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,10 +1,18 @@ // offset-allocator/src/lib.rs +#![no_std] #![doc = include_str!("../README.md")] #![deny(unsafe_code)] #![warn(missing_docs)] -use std::fmt::{Debug, Display, Formatter, Result as FmtResult}; +extern crate alloc; + +#[cfg(test)] +extern crate std; + +use alloc::vec; +use alloc::vec::Vec; +use core::fmt::{Debug, Display, Formatter, Result as FmtResult}; use log::debug; use nonmax::{NonMaxU16, NonMaxU32};