diff --git a/src/lib.rs b/src/lib.rs index 15146f2..13d261b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -253,6 +253,13 @@ #![warn(rust_2018_idioms)] #![deny(missing_docs)] // refuse to compile if documentation is missing +#[cfg(any(feature = "std", test))] +#[macro_use] +extern crate std; + +#[cfg(feature = "alloc")] +#[macro_use] +extern crate alloc; extern crate curve25519_dalek; extern crate merlin; @@ -264,16 +271,11 @@ extern crate rand_chacha; extern crate failure; +extern crate ed25519_dalek; #[cfg(test)] extern crate sha3; -extern crate ed25519_dalek; - -#[cfg(any(feature = "std", test))] -#[macro_use] -extern crate std; - extern crate sha2; // #[cfg(test)] diff --git a/src/musig.rs b/src/musig.rs index 222bb23..b0ebc60 100644 --- a/src/musig.rs +++ b/src/musig.rs @@ -34,10 +34,9 @@ use core::borrow::{Borrow}; // BorrowMut #[cfg(feature = "alloc")] -use alloc::collections::{BTreeMap, btree_map::Entry}; +use alloc::{collections::btree_map::{BTreeMap, Entry}}; #[cfg(feature = "std")] -use std::collections::{BTreeMap, btree_map::Entry}; - +use std::{collections::btree_map::{BTreeMap, Entry}}; use merlin::Transcript; use clear_on_drop::clear::Clear; diff --git a/src/sign.rs b/src/sign.rs index b3e62e8..fb5d40d 100644 --- a/src/sign.rs +++ b/src/sign.rs @@ -265,7 +265,7 @@ where T: SigningTranscript, I: IntoIterator, { - const ASSERT_MESSAGE: &'static [u8] = b"The number of messages/transcripts, signatures, and public keys must be equal."; + const ASSERT_MESSAGE: &'static str = "The number of messages/transcripts, signatures, and public keys must be equal."; assert!(signatures.len() == public_keys.len(), ASSERT_MESSAGE); // Check transcripts length below #[cfg(feature = "alloc")] diff --git a/src/vrf.rs b/src/vrf.rs index fd46070..da02463 100644 --- a/src/vrf.rs +++ b/src/vrf.rs @@ -801,7 +801,7 @@ pub fn dleq_verify_batch( ) -> bool { use curve25519_dalek::traits::IsIdentity; - const ASSERT_MESSAGE: &'static [u8] = b"The number of messages/transcripts / input points, output points, proofs, and public keys must be equal."; + const ASSERT_MESSAGE: &'static str = "The number of messages/transcripts / input points, output points, proofs, and public keys must be equal."; assert!(ps.len() == proofs.len(), ASSERT_MESSAGE); assert!(proofs.len() == public_keys.len(), ASSERT_MESSAGE);