Warp: Why are HTTP methods suffixed with 2?

Created on 6 Dec 2019  路  1Comment  路  Source: seanmonstar/warp

In some of the examples provided there is a 2 as a suffix to HTTP methods, but this doesn't appear to be explained to new users what is going on with that?

Looks like it is referred to as v2 and discussed here?

I came across these v2 variants in the docs here, but the related docs appear to just import warp::Filters and use the suffixed 2 variants, even though the docs for that module have no suffix on them? It's a little confusing. Moving up the module path in the docs, this appears to be due to v2 being re-exported with the 2 suffix?

I think my confusion may have come from seeing examples of current stable and development(master) branches. body.rs example stable vs master shows that the 2 suffix is removed now? So this will be going away in a future release?

Most helpful comment

Yes, the 2 suffix was because the first version of those filters was odd, and the second version made them behave like all the rest (but was a breaking API change). In the next version coming real soon, we were able to replace the first version with the second and remove the prefix.

>All comments

Yes, the 2 suffix was because the first version of those filters was odd, and the second version made them behave like all the rest (but was a breaking API change). In the next version coming real soon, we were able to replace the first version with the second and remove the prefix.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

silvioprog picture silvioprog  路  3Comments

Newbytee picture Newbytee  路  7Comments

clintnetwork picture clintnetwork  路  3Comments

seanmonstar picture seanmonstar  路  8Comments

alexreg picture alexreg  路  7Comments