actix / actix/actix-net

impl Transform for Option

Aperta
#465 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Rust
Stelle
775
Fork
363
Merge medio
21h 2m
PR unite (30g)
31

Descrizione

This topic continues https://github.com/actix/actix-web/pull/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`. This would mean moving the `ConditionMiddleware` code too.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.