Skip to content

impl Transform for Option #465

@KoltesDigital

Description

@KoltesDigital

This topic continues actix/actix-web#2858 , whole goal is to .wrap an optional middleware. Condition middleware exists but requires a transformer even when unused. It seems to me that using an Option is more natural. But as that PR was on a different crate than Transform's, a newtype was introduced, and .into() required an explicit annotation. Sadly this was non-optimal.

@fakeshadow suggested that this feature should rather be moved into Transform's crate, so that .wrap can natively take an Option<SomeMiddleware>. This would mean moving the ConditionMiddleware code too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions