Improve crate root re-exports
When we moved to edition 2018 the use of `extern` became unnecessary and we moved to using `pub use` for re-exports. It was observed however that `pub extern crate` is more readable. Improve crate root re-exports by doing: - Use `pub extern crate foo` to re-export foo. - Fix docs attribute for optional dependency `bitcoinconsensus`. - Re-order to how rustfmt would put them.
This commit is contained in:
parent
130a5845bd
commit
fb7ff46ccc
|
@ -63,20 +63,18 @@ extern crate test;
|
|||
#[macro_use]
|
||||
extern crate alloc;
|
||||
|
||||
// Re-export dependencies we control.
|
||||
#[cfg(feature = "bitcoinconsensus")]
|
||||
pub use bitcoinconsensus;
|
||||
pub use {bech32, bitcoin_hashes as hashes, secp256k1};
|
||||
|
||||
// Re-export base64 when enabled
|
||||
#[cfg(feature = "base64")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "base64")))]
|
||||
pub use base64;
|
||||
|
||||
// Re-export hashbrown when enabled
|
||||
pub extern crate base64;
|
||||
pub extern crate bech32;
|
||||
pub extern crate bitcoin_hashes as hashes;
|
||||
#[cfg(feature = "bitcoinconsensus")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "bitcoinconsensus")))]
|
||||
pub extern crate bitcoinconsensus;
|
||||
#[cfg(feature = "hashbrown")]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "hashbrown")))]
|
||||
pub use hashbrown;
|
||||
pub extern crate hashbrown;
|
||||
pub extern crate secp256k1;
|
||||
|
||||
#[cfg(feature = "serde")]
|
||||
#[macro_use]
|
||||
|
|
Loading…
Reference in New Issue