From 583bdf821befbee4e09161ff92398f1e75372456 Mon Sep 17 00:00:00 2001 From: Shady Khalifa Date: Thu, 20 Oct 2022 14:58:07 +0200 Subject: [PATCH] make it compile with no_std --- src/keys.rs | 3 +++ src/lib.rs | 20 +------------------- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/src/keys.rs b/src/keys.rs index ed0265f..c9d9b7a 100644 --- a/src/keys.rs +++ b/src/keys.rs @@ -2,6 +2,9 @@ extern crate amcl; extern crate rand; extern crate zeroize; +#[cfg(not(feature = "std"))] +use alloc::vec::Vec; + use self::zeroize::Zeroize; use super::amcl_utils::{ self, compress_g1, decompress_g1, g1mul, subgroup_check_g1, AmclError, Big, GroupG1, diff --git a/src/lib.rs b/src/lib.rs index 05cabf6..f2d3411 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,26 +1,8 @@ -#![cfg_attr( - not(feature = "std"), - no_std, - feature(alloc), - feature(alloc_prelude), - feature(prelude_import) -)] +#![cfg_attr(not(feature = "std"), no_std)] #[cfg(not(feature = "std"))] -#[macro_use] extern crate alloc; -#[cfg(not(feature = "std"))] -pub(crate) mod prelude { - pub use alloc::prelude::v1::*; - pub use core::prelude::v1::*; -} - -#[cfg(not(feature = "std"))] -#[allow(unused)] -#[prelude_import] -use crate::prelude::*; - extern crate amcl; #[cfg(feature = "std")] #[macro_use]