carllerche / tower-web

A fast, boilerplate free, web framework for Rust
MIT License
980 stars 51 forks source link

Prevent duplicate routes in compile time #195

Closed Abogical closed 5 years ago

Abogical commented 5 years ago

Fixes #135 . I haven't figured out how to write the test though, any help?

carllerche commented 5 years ago

@Abogical looks good to me. It also does seem like you got a test. I'm happy to merge if you are (still have WIP in the title).

Abogical commented 5 years ago

The test just doesn't work that's why I'm putting it in WIP. testing it outside the crate with impl_web!macro works, but directly calling the function expand_derive_resource doesn't. I'm not familiar with the codebase as you are. What am I missing?

Abogical commented 5 years ago

Also travis doesn't test the macros, I've opened a new issue. (#197)

Abogical commented 5 years ago

Test is fixed now. You can merge.

lnicola commented 5 years ago

Was this technically a breaking change?

carllerche commented 5 years ago

unsure... the original behavior was not defined.

lnicola commented 5 years ago

Undefined as in UB, or undefined as in "happened to pick one of the handlers"? If the latter, it sounds like a breaking change, not that I have anything against it.

carllerche commented 5 years ago

happened to pick one of the handlers.

I did not consider the breaking change aspect. At this point, i would leave it unless there is a report.