mirror of
https://github.com/actix/actix-extras.git
synced 2025-02-23 10:53:02 +01:00
Fix linter errors.
This commit is contained in:
parent
d7ffa0aac8
commit
a83919a719
16
src/lib.rs
16
src/lib.rs
@ -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() {
|
//! let server = HttpServer::new(|| {
|
||||||
//! // Init your `tracing` subscriber here!
|
//! App::new()
|
||||||
//!
|
//! // Mount `TracingLogger` as a middleware
|
||||||
//! let server = HttpServer::new(|| {
|
//! .wrap(TracingLogger::default())
|
||||||
//! App::new()
|
//! .service( /* */ )
|
||||||
//! // Mount `TracingLogger` as a middleware
|
//! });
|
||||||
//! .wrap(TracingLogger::default())
|
|
||||||
//! .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
|
||||||
|
@ -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>,
|
||||||
|
@ -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(
|
||||||
|
@ -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(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user