1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-06-26 16:17:43 +02:00

add future::Either type to utils (#305)

This commit is contained in:
Rob Ede
2021-04-01 13:53:44 +01:00
committed by GitHub
parent b068ea16f8
commit fb27ffc525
8 changed files with 104 additions and 7 deletions

View File

@ -17,8 +17,8 @@ path = "src/lib.rs"
[dependencies]
actix-service = "2.0.0-beta.5"
actix-utils = "3.0.0-beta.3"
futures-util = { version = "0.3.7", default-features = false }
tracing = "0.1"
tracing-futures = "0.2"

View File

@ -9,7 +9,7 @@ use core::marker::PhantomData;
use actix_service::{
apply, ApplyTransform, IntoServiceFactory, Service, ServiceFactory, Transform,
};
use futures_util::future::{ok, Either, Ready};
use actix_utils::future::{ok, Either, Ready};
use tracing_futures::{Instrument, Instrumented};
/// A `Service` implementation that automatically enters/exits tracing spans
@ -48,9 +48,9 @@ where
.clone()
.map(|span| tracing::span!(parent: &span, tracing::Level::INFO, "future"))
{
Either::Right(fut.instrument(span))
Either::right(fut.instrument(span))
} else {
Either::Left(fut)
Either::left(fut)
}
}
}