1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-02-22 18:33:18 +01:00

reduce imports (#27)

This commit is contained in:
Rob Ede 2021-07-13 07:19:41 +01:00 committed by GitHub
parent fd2b13f040
commit 72aa916fe7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 7 deletions

View File

@ -25,9 +25,7 @@ opentelemetry_0_14 = ["opentelemetry_0_14_pkg", "tracing-opentelemetry_0_13_pkg"
emit_event_on_error = []
[dependencies]
actix-web = "=4.0.0-beta.8"
actix-http = "=3.0.0-beta.8"
actix-service = "^2.0.0"
actix-web = { version = "=4.0.0-beta.8", default-features = false }
tracing = "0.1.19"
tracing-futures = "0.2.4"
futures = "0.3.5"

View File

@ -2,7 +2,6 @@ use crate::{DefaultRootSpanBuilder, RequestId, RootSpan, RootSpanBuilder};
use actix_web::dev::{Service, ServiceRequest, ServiceResponse, Transform};
use actix_web::{Error, HttpMessage, ResponseError};
use futures::future::{ok, Ready};
use futures::task::{Context, Poll};
use std::future::Future;
use std::pin::Pin;
use tracing::Span;
@ -125,9 +124,7 @@ where
type Error = Error;
type Future = Pin<Box<dyn Future<Output = Result<Self::Response, Self::Error>>>>;
fn poll_ready(&self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
self.service.poll_ready(cx)
}
actix_web::dev::forward_ready!(service);
fn call(&self, req: ServiceRequest) -> Self::Future {
req.extensions_mut().insert(RequestId::generate());