diff --git a/crates/bitcoind_rpc/src/bip158.rs b/crates/bitcoind_rpc/src/bip158.rs index 81963def6..4caf59fcd 100644 --- a/crates/bitcoind_rpc/src/bip158.rs +++ b/crates/bitcoind_rpc/src/bip158.rs @@ -173,8 +173,7 @@ impl core::fmt::Display for Error { } } -#[cfg(feature = "std")] -impl std::error::Error for Error {} +impl core::error::Error for Error {} impl From for Error { fn from(e: bitcoincore_rpc::Error) -> Self { diff --git a/crates/chain/src/indexer/keychain_txout.rs b/crates/chain/src/indexer/keychain_txout.rs index 6f977b8e1..cbad66696 100644 --- a/crates/chain/src/indexer/keychain_txout.rs +++ b/crates/chain/src/indexer/keychain_txout.rs @@ -1022,8 +1022,7 @@ impl core::fmt::Display for InsertDescriptorError { } } -#[cfg(feature = "std")] -impl std::error::Error for InsertDescriptorError {} +impl core::error::Error for InsertDescriptorError {} /// `ChangeSet` represents persistent updates to a [`KeychainTxOutIndex`]. /// diff --git a/crates/chain/src/indexer/spk_txout.rs b/crates/chain/src/indexer/spk_txout.rs index 2bf78ec2d..e63eb1201 100644 --- a/crates/chain/src/indexer/spk_txout.rs +++ b/crates/chain/src/indexer/spk_txout.rs @@ -332,7 +332,7 @@ impl SpkTxOutIndex { /// # use bitcoin::{Address, Network, Transaction}; /// # use std::str::FromStr; /// # - /// # fn example() -> Result<(), Box> { + /// # fn example() -> Result<(), Box> { /// let mut index = SpkTxOutIndex::::default(); /// /// // ... scan transactions to populate the index ... @@ -382,7 +382,7 @@ impl SpkTxOutIndex { /// # use bitcoin::{Address, Network, Transaction}; /// # use std::str::FromStr; /// # - /// # fn example() -> Result<(), Box> { + /// # fn example() -> Result<(), Box> { /// let mut index = SpkTxOutIndex::::default(); /// /// // ... scan transactions to populate the index ... diff --git a/crates/chain/src/local_chain.rs b/crates/chain/src/local_chain.rs index 81f4a1796..5bfff3aa9 100644 --- a/crates/chain/src/local_chain.rs +++ b/crates/chain/src/local_chain.rs @@ -498,8 +498,7 @@ impl core::fmt::Display for MissingGenesisError { } } -#[cfg(feature = "std")] -impl std::error::Error for MissingGenesisError {} +impl core::error::Error for MissingGenesisError {} /// Represents a failure when trying to insert/remove a checkpoint to/from [`LocalChain`]. #[derive(Clone, Debug, PartialEq)] @@ -529,8 +528,7 @@ impl core::fmt::Display for AlterCheckPointError { } } -#[cfg(feature = "std")] -impl std::error::Error for AlterCheckPointError {} +impl core::error::Error for AlterCheckPointError {} /// Occurs when an update does not have a common checkpoint with the original chain. #[derive(Clone, Debug, PartialEq)] @@ -549,8 +547,7 @@ impl core::fmt::Display for CannotConnectError { } } -#[cfg(feature = "std")] -impl std::error::Error for CannotConnectError {} +impl core::error::Error for CannotConnectError {} /// The error type for [`LocalChain::apply_header_connected_to`]. #[derive(Debug, Clone, PartialEq)] @@ -573,8 +570,7 @@ impl core::fmt::Display for ApplyHeaderError { } } -#[cfg(feature = "std")] -impl std::error::Error for ApplyHeaderError {} +impl core::error::Error for ApplyHeaderError {} /// Applies `update_tip` onto `original_tip`. /// diff --git a/crates/chain/src/rusqlite_impl.rs b/crates/chain/src/rusqlite_impl.rs index 7e9e2f6f9..ad89f429e 100644 --- a/crates/chain/src/rusqlite_impl.rs +++ b/crates/chain/src/rusqlite_impl.rs @@ -185,11 +185,11 @@ impl ToSql for Impl { } } -fn from_sql_error(err: E) -> FromSqlError { +fn from_sql_error(err: E) -> FromSqlError { FromSqlError::Other(Box::new(err)) } -fn to_sql_error(err: E) -> rusqlite::Error { +fn to_sql_error(err: E) -> rusqlite::Error { rusqlite::Error::ToSqlConversionFailure(Box::new(err)) } diff --git a/crates/chain/src/tx_graph.rs b/crates/chain/src/tx_graph.rs index 701de335d..44c34c2d7 100644 --- a/crates/chain/src/tx_graph.rs +++ b/crates/chain/src/tx_graph.rs @@ -287,8 +287,7 @@ impl fmt::Display for CalculateFeeError { } } -#[cfg(feature = "std")] -impl std::error::Error for CalculateFeeError {} +impl core::error::Error for CalculateFeeError {} impl TxGraph { /// Iterate over all tx outputs known by [`TxGraph`]. diff --git a/crates/file_store/src/lib.rs b/crates/file_store/src/lib.rs index 5a7d50304..3731d5030 100644 --- a/crates/file_store/src/lib.rs +++ b/crates/file_store/src/lib.rs @@ -53,4 +53,4 @@ impl From for StoreError { } } -impl std::error::Error for StoreError {} +impl core::error::Error for StoreError {} diff --git a/crates/file_store/src/store.rs b/crates/file_store/src/store.rs index 7e1867926..858b9d2cd 100644 --- a/crates/file_store/src/store.rs +++ b/crates/file_store/src/store.rs @@ -278,7 +278,7 @@ impl std::fmt::Display for StoreErrorWithDump { } } -impl std::error::Error for StoreErrorWithDump {} +impl core::error::Error for StoreErrorWithDump {} #[cfg(test)] #[cfg_attr(coverage_nightly, coverage(off))] diff --git a/examples/example_cli/src/lib.rs b/examples/example_cli/src/lib.rs index 2b910a1a0..6745ae6c1 100644 --- a/examples/example_cli/src/lib.rs +++ b/examples/example_cli/src/lib.rs @@ -268,7 +268,7 @@ pub fn create_tx( feerate: f32, ) -> anyhow::Result<(Psbt, Option)> where - O::Error: std::error::Error + Send + Sync + 'static, + O::Error: core::error::Error + Send + Sync + 'static, { let mut changeset = keychain_txout::ChangeSet::default();