Skip to content

Commit eba8e71

Browse files
committed
Merge #164: Remove std feature gates
b14f1a3 Remove std feature gates (Christian Lewe) Pull request description: There is no `std` feature in rust-elements. This is a copy-and-paste error from rust-bitcoin. ACKs for top commit: apoelstra: ACK b14f1a3 Tree-SHA512: 4cce9e662e3191a36cd5acf78e4dec668c731ed43e2998ac7afbb7066e8714e02f198ea63e7c571e62285f5c76983522307bb9a053e3dcb34a84a37a26f3ccdf
2 parents 6606a0d + b14f1a3 commit eba8e71

3 files changed

Lines changed: 5 additions & 24 deletions

File tree

src/error.rs

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,10 @@ pub use crate::parse::ParseIntError;
77
macro_rules! impl_std_error {
88
// No source available
99
($type:ty) => {
10-
#[cfg(feature = "std")]
11-
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
1210
impl std::error::Error for $type {}
1311
};
1412
// Struct with $field as source
1513
($type:ty, $field:ident) => {
16-
#[cfg(feature = "std")]
17-
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
1814
impl std::error::Error for $type {
1915
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
2016
Some(&self.$field)
@@ -29,18 +25,11 @@ pub(crate) use impl_std_error;
2925
/// lost for no-std builds.
3026
macro_rules! write_err {
3127
($writer:expr, $string:literal $(, $args:expr)*; $source:expr) => {
32-
{
33-
#[cfg(feature = "std")]
34-
{
35-
let _ = &$source; // Prevents clippy warnings.
36-
write!($writer, $string $(, $args)*)
37-
}
38-
#[cfg(not(feature = "std"))]
39-
{
40-
write!($writer, concat!($string, ": {}") $(, $args)*, $source)
41-
}
42-
}
43-
}
28+
{
29+
let _ = &$source; // Prevents clippy warnings.
30+
write!($writer, $string $(, $args)*)
31+
}
32+
}
4433
}
4534
pub(crate) use write_err;
4635

src/locktime.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -600,8 +600,6 @@ impl fmt::Display for Error {
600600
}
601601
}
602602

603-
#[cfg(feature = "std")]
604-
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
605603
impl std::error::Error for Error {
606604
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
607605
use self::Error::*;
@@ -665,8 +663,6 @@ impl fmt::Display for ConversionError {
665663
}
666664
}
667665

668-
#[cfg(feature = "std")]
669-
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
670666
impl std::error::Error for ConversionError {}
671667

672668
/// Describes the two types of locking, lock-by-blockheight and lock-by-blocktime.
@@ -707,8 +703,6 @@ impl fmt::Display for OperationError {
707703
}
708704
}
709705

710-
#[cfg(feature = "std")]
711-
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
712706
impl std::error::Error for OperationError {}
713707

714708
#[cfg(test)]

src/transaction.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,6 @@ impl fmt::Display for RelativeLockTimeError {
333333

334334
impl_parse_str_through_int!(Sequence);
335335

336-
#[cfg(feature = "std")]
337-
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
338336
impl std::error::Error for RelativeLockTimeError {
339337
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
340338
match self {

0 commit comments

Comments
 (0)