1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-02-23 19:03:03 +01:00

Fix linter errors.

This commit is contained in:
LukeMathWalker 2021-08-13 11:02:32 +01:00
parent d7ffa0aac8
commit a83919a719
4 changed files with 16 additions and 18 deletions

View File

@ -28,16 +28,12 @@
//! use actix_web::{App, web, HttpServer}; //! use actix_web::{App, web, HttpServer};
//! use tracing_actix_web::TracingLogger; //! use tracing_actix_web::TracingLogger;
//! //!
//! fn main() {
//! // Init your `tracing` subscriber here!
//!
//! let server = HttpServer::new(|| { //! let server = HttpServer::new(|| {
//! App::new() //! App::new()
//! // Mount `TracingLogger` as a middleware //! // Mount `TracingLogger` as a middleware
//! .wrap(TracingLogger::default()) //! .wrap(TracingLogger::default())
//! .service( /* */ ) //! .service( /* */ )
//! }); //! });
//! }
//! ``` //! ```
//! //!
//! Check out [the examples on GitHub](https://github.com/LukeMathWalker/tracing-actix-web/tree/main/examples) to get a taste of how [`TracingLogger`] can be used to observe and monitor your //! Check out [the examples on GitHub](https://github.com/LukeMathWalker/tracing-actix-web/tree/main/examples) to get a taste of how [`TracingLogger`] can be used to observe and monitor your

View File

@ -113,6 +113,7 @@ pub struct TracingLoggerMiddleware<S, RootSpanBuilder> {
root_span_builder: std::marker::PhantomData<RootSpanBuilder>, root_span_builder: std::marker::PhantomData<RootSpanBuilder>,
} }
#[allow(clippy::type_complexity)]
impl<S, B, RootSpanType> Service<ServiceRequest> for TracingLoggerMiddleware<S, RootSpanType> impl<S, B, RootSpanType> Service<ServiceRequest> for TracingLoggerMiddleware<S, RootSpanType>
where where
S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error>, S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error>,

View File

@ -42,9 +42,9 @@ impl std::ops::Deref for RequestId {
} }
} }
impl std::convert::Into<Uuid> for RequestId { impl From<RequestId> for Uuid {
fn into(self) -> Uuid { fn from(r: RequestId) -> Self {
self.0 r.0
} }
} }
@ -53,10 +53,11 @@ impl std::fmt::Display for RequestId {
write!(f, "{}", self.0) write!(f, "{}", self.0)
} }
} }
impl FromRequest for RequestId { impl FromRequest for RequestId {
type Config = ();
type Error = RequestIdExtractionError; type Error = RequestIdExtractionError;
type Future = Ready<Result<Self, Self::Error>>; type Future = Ready<Result<Self, Self::Error>>;
type Config = ();
fn from_request(req: &HttpRequest, _: &mut Payload) -> Self::Future { fn from_request(req: &HttpRequest, _: &mut Payload) -> Self::Future {
ready( ready(

View File

@ -40,16 +40,16 @@ impl std::ops::Deref for RootSpan {
} }
} }
impl std::convert::Into<Span> for RootSpan { impl From<RootSpan> for Span {
fn into(self) -> Span { fn from(r: RootSpan) -> Self {
self.0 r.0
} }
} }
impl FromRequest for RootSpan { impl FromRequest for RootSpan {
type Config = ();
type Error = RootSpanExtractionError; type Error = RootSpanExtractionError;
type Future = Ready<Result<Self, Self::Error>>; type Future = Ready<Result<Self, Self::Error>>;
type Config = ();
fn from_request(req: &HttpRequest, _: &mut Payload) -> Self::Future { fn from_request(req: &HttpRequest, _: &mut Payload) -> Self::Future {
ready( ready(