From 391c53aa60a38c5c975de22671b7ee56490858f5 Mon Sep 17 00:00:00 2001 From: teor Date: Mon, 25 Jan 2021 19:33:47 +1000 Subject: [PATCH] Move BoxError to zebrad's lib.rs For consistency with other crates. --- zebrad/src/components/sync.rs | 4 +--- zebrad/src/lib.rs | 7 +++++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/zebrad/src/components/sync.rs b/zebrad/src/components/sync.rs index ff36bc6c..55078762 100644 --- a/zebrad/src/components/sync.rs +++ b/zebrad/src/components/sync.rs @@ -18,7 +18,7 @@ use zebra_chain::{ use zebra_network as zn; use zebra_state as zs; -use crate::config::ZebradConfig; +use crate::{config::ZebradConfig, BoxError}; mod downloads; use downloads::{AlwaysHedge, Downloads}; @@ -114,8 +114,6 @@ pub(super) const BLOCK_VERIFY_TIMEOUT: Duration = Duration::from_secs(180); /// previous sync runs. const SYNC_RESTART_DELAY: Duration = Duration::from_secs(61); -type BoxError = Box; - /// Helps work around defects in the bitcoin protocol by checking whether /// the returned hashes actually extend a chain tip. #[derive(Copy, Clone, Debug, Hash, PartialEq, Eq)] diff --git a/zebrad/src/lib.rs b/zebrad/src/lib.rs index 19a432f0..64944fba 100644 --- a/zebrad/src/lib.rs +++ b/zebrad/src/lib.rs @@ -26,6 +26,13 @@ #[macro_use] extern crate tracing; +/// Error type alias to make working with tower traits easier. +/// +/// Note: the 'static lifetime bound means that the *type* cannot have any +/// non-'static lifetimes, (e.g., when a type contains a borrow and is +/// parameterized by 'a), *not* that the object itself has 'static lifetime. +pub type BoxError = Box; + mod components; pub mod application;