From 23ee0930c75c3c028572c521e0906fd4f95b6b92 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Tue, 7 Jun 2022 13:00:01 +1000 Subject: [PATCH] Remove extern crate Now we have edition 2018 we do not need to use `macro_use` or `extern crate`; `pub use` works with macros. Notable exceptions are `alloc` and `test`. Also leave the serde rename because touching it opens a can of worms. --- src/lib.rs | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index eff15e8e..aa3f0fcb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -59,32 +59,18 @@ extern crate test; #[cfg(feature = "no-std")] #[macro_use] extern crate alloc; -#[cfg(feature = "no-std")] -extern crate core2; -// Re-exported dependencies. +// Re-export dependencies we control. pub use bitcoin_hashes as hashes; -pub extern crate bech32; -pub extern crate secp256k1; +pub use secp256k1; +pub use bech32; +#[cfg(feature="bitcoinconsensus")] +pub use bitcoinconsensus; -#[cfg(feature = "no-std")] -extern crate hashbrown; - -#[cfg(feature = "base64")] -#[cfg_attr(docsrs, doc(cfg(feature = "base64")))] -pub extern crate base64; - -#[cfg(feature = "bitcoinconsensus")] -extern crate bitcoinconsensus; #[cfg(feature = "serde")] #[macro_use] extern crate actual_serde as serde; -#[cfg(all(test, feature = "serde"))] -extern crate bincode; -#[cfg(all(test, feature = "serde"))] -extern crate serde_json; -#[cfg(all(test, feature = "serde"))] -extern crate serde_test; + #[cfg(test)] #[macro_use]