diff --git a/src/lib.rs b/src/lib.rs index f59af63..751eb24 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -21,15 +21,23 @@ unsafe_code )] #![warn(rust_2018_idioms)] +#![no_std] + +extern crate alloc; + +#[cfg(test)] +extern crate std; mod u256; -use std::{ +use alloc::{ collections::{BTreeMap, BTreeSet, VecDeque}, - ops::RangeFrom, + vec, + vec::Vec, }; +use core::ops::RangeFrom; -use u256::U256; +use self::u256::U256; #[derive(Debug, Clone)] #[repr(transparent)] diff --git a/src/u256.rs b/src/u256.rs index bfee984..48b76d6 100644 --- a/src/u256.rs +++ b/src/u256.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::{ +use core::{ cmp::Ordering, ops::{ Add, AddAssign, BitAnd, BitOrAssign, Shl, ShlAssign, Sub, SubAssign,