mirror of
https://github.com/fafhrd91/actix-net
synced 2025-08-18 22:05:32 +02:00
add future::Either type to utils (#305)
This commit is contained in:
@@ -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"
|
||||
|
||||
|
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user