1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-06-27 04:59:02 +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

@ -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)
}
}
}