The `Error` trait is stable as of 1.81.0, so import it from `core` instead.
}
}
-#[cfg(feature = "std")]
-impl std::error::Error for Error {}
+impl core::error::Error for Error {}
impl From<bitcoincore_rpc::Error> for Error {
fn from(e: bitcoincore_rpc::Error) -> Self {
}
}
-#[cfg(feature = "std")]
-impl<K: core::fmt::Display + core::fmt::Debug> std::error::Error for InsertDescriptorError<K> {}
+impl<K: core::fmt::Display + core::fmt::Debug> core::error::Error for InsertDescriptorError<K> {}
/// `ChangeSet` represents persistent updates to a [`KeychainTxOutIndex`].
///
/// # use bitcoin::{Address, Network, Transaction};
/// # use std::str::FromStr;
/// #
- /// # fn example() -> Result<(), Box<dyn std::error::Error>> {
+ /// # fn example() -> Result<(), Box<dyn core::error::Error>> {
/// let mut index = SpkTxOutIndex::<u32>::default();
///
/// // ... scan transactions to populate the index ...
/// # use bitcoin::{Address, Network, Transaction};
/// # use std::str::FromStr;
/// #
- /// # fn example() -> Result<(), Box<dyn std::error::Error>> {
+ /// # fn example() -> Result<(), Box<dyn core::error::Error>> {
/// let mut index = SpkTxOutIndex::<u32>::default();
///
/// // ... scan transactions to populate the index ...
}
}
-#[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)]
}
}
-#[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)]
}
}
-#[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)]
}
}
-#[cfg(feature = "std")]
-impl std::error::Error for ApplyHeaderError {}
+impl core::error::Error for ApplyHeaderError {}
/// Applies `update_tip` onto `original_tip`.
///
}
}
-fn from_sql_error<E: std::error::Error + Send + Sync + 'static>(err: E) -> FromSqlError {
+fn from_sql_error<E: core::error::Error + Send + Sync + 'static>(err: E) -> FromSqlError {
FromSqlError::Other(Box::new(err))
}
-fn to_sql_error<E: std::error::Error + Send + Sync + 'static>(err: E) -> rusqlite::Error {
+fn to_sql_error<E: core::error::Error + Send + Sync + 'static>(err: E) -> rusqlite::Error {
rusqlite::Error::ToSqlConversionFailure(Box::new(err))
}
}
}
-#[cfg(feature = "std")]
-impl std::error::Error for CalculateFeeError {}
+impl core::error::Error for CalculateFeeError {}
impl<A> TxGraph<A> {
/// Iterate over all tx outputs known by [`TxGraph`].
}
}
-impl std::error::Error for StoreError {}
+impl core::error::Error for StoreError {}
}
}
-impl<C: fmt::Debug> std::error::Error for StoreErrorWithDump<C> {}
+impl<C: fmt::Debug> core::error::Error for StoreErrorWithDump<C> {}
#[cfg(test)]
#[cfg_attr(coverage_nightly, coverage(off))]
feerate: f32,
) -> anyhow::Result<(Psbt, Option<ChangeInfo>)>
where
- O::Error: std::error::Error + Send + Sync + 'static,
+ O::Error: core::error::Error + Send + Sync + 'static,
{
let mut changeset = keychain_txout::ChangeSet::default();