Skip to content

Update doc example of actix middleware #227

@tumbl3w33d

Description

@tumbl3w33d

Hi,

since v2 this middleware documentation example won't compile anymore due to lack of Req type declaration: https://actix.rs/docs/middleware/

I've been fiddling around with it to make my middleware compatible, but couldn't figure this one out:

impl<S, B> Transform<S, B> for MyMiddleware
where
    S: Service<Request = ServiceRequest, Response = ServiceResponse<B>, Error = Error>,
    S::Future: 'static,
    B: 'static,
{

the compiler complains about
S: Service<Request = ServiceRequest, Response = ServiceResponse<B>, Error = Error>,
because

wrong number of type arguments: expected 1, found 0
expected 1 type argument

Metadata

Metadata

Assignees

No one assigned

    Labels

    codeChange to code samplesgood-first-issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions