From 98bf213c52c3639ee4b78a1ee573147340693ad5 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Wed, 15 May 2024 08:10:58 +1000 Subject: [PATCH] bitcoin: Remove error module The `error` module is empty except for public re-exports. We are still in the "break everything and get the API right" stage so this module adds no value - remove it. --- bitcoin/src/blockdata/transaction.rs | 2 +- bitcoin/src/error.rs | 9 --------- bitcoin/src/lib.rs | 1 - bitcoin/src/pow.rs | 3 +-- 4 files changed, 2 insertions(+), 13 deletions(-) delete mode 100644 bitcoin/src/error.rs diff --git a/bitcoin/src/blockdata/transaction.rs b/bitcoin/src/blockdata/transaction.rs index 767410c46..a7b07b0aa 100644 --- a/bitcoin/src/blockdata/transaction.rs +++ b/bitcoin/src/blockdata/transaction.rs @@ -120,7 +120,7 @@ pub enum ParseOutPointError { /// Error in TXID part. Txid(hex::HexToArrayError), /// Error in vout part. - Vout(crate::error::ParseIntError), + Vout(parse::ParseIntError), /// Error in general format. Format, /// Size exceeds max. diff --git a/bitcoin/src/error.rs b/bitcoin/src/error.rs deleted file mode 100644 index bc70574fd..000000000 --- a/bitcoin/src/error.rs +++ /dev/null @@ -1,9 +0,0 @@ -// SPDX-License-Identifier: CC0-1.0 - -//! Contains error types and other error handling tools. - -#[rustfmt::skip] // Keep public re-exports separate. -#[doc(inline)] -pub use units::parse::{ - ContainsPrefixError, MissingPrefixError, ParseIntError, PrefixedHexError, UnprefixedHexError, -}; diff --git a/bitcoin/src/lib.rs b/bitcoin/src/lib.rs index 3d10ba656..3db99fa7d 100644 --- a/bitcoin/src/lib.rs +++ b/bitcoin/src/lib.rs @@ -100,7 +100,6 @@ pub mod blockdata; pub mod consensus; // Private until we either make this a crate or flatten it - still to be decided. pub(crate) mod crypto; -pub mod error; pub mod hash_types; pub mod merkle_tree; pub mod network; diff --git a/bitcoin/src/pow.rs b/bitcoin/src/pow.rs index 09e135763..1642bef46 100644 --- a/bitcoin/src/pow.rs +++ b/bitcoin/src/pow.rs @@ -12,13 +12,12 @@ use core::ops::{Add, Div, Mul, Not, Rem, Shl, Shr, Sub}; use io::{BufRead, Write}; #[cfg(all(test, mutate))] use mutagen::mutate; -use units::parse; +use units::parse::{self, ParseIntError, PrefixedHexError, UnprefixedHexError}; use crate::block::Header; use crate::blockdata::block::BlockHash; use crate::consensus::encode::{self, Decodable, Encodable}; use crate::consensus::Params; -use crate::error::{ParseIntError, PrefixedHexError, UnprefixedHexError}; /// Implement traits and methods shared by `Target` and `Work`. macro_rules! do_impl {