From 8072d5b7e8c272ba1a725f6d158acd47bb278f88 Mon Sep 17 00:00:00 2001 From: teor Date: Wed, 10 Jun 2020 20:39:51 +1000 Subject: [PATCH] state: Add an Error type alias to ZebraState --- zebra-state/src/in_memory.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/zebra-state/src/in_memory.rs b/zebra-state/src/in_memory.rs index 0309d783..a494363c 100644 --- a/zebra-state/src/in_memory.rs +++ b/zebra-state/src/in_memory.rs @@ -1,7 +1,7 @@ use super::{Request, Response}; use futures::prelude::*; use std::{ - error::Error, + error, future::Future, pin::Pin, task::{Context, Poll}, @@ -15,9 +15,11 @@ struct ZebraState { index: block_index::BlockIndex, } +type Error = Box; + impl Service for ZebraState { type Response = Response; - type Error = Box; + type Error = Error; type Future = Pin> + Send + 'static>>; @@ -58,8 +60,8 @@ impl Service for ZebraState { pub fn init() -> impl Service< Request, Response = Response, - Error = Box, - Future = impl Future>>, + Error = Error, + Future = impl Future>, > + Send + Clone + 'static {