mellowagain / gitarena

Software development platform with built-in vcs, issue tracking and code review
MIT License
82 stars 10 forks source link

make middleware generic over body type #48

Closed aliemjay closed 2 years ago

aliemjay commented 2 years ago

This would cut down verbosity by removing the EitherBody from the middleware.

The file was edited from the browser for prototyping, and it may even have syntax error. Feel free to close it.

mellowagain commented 2 years ago

Thank you for your contribution, I didn't know the remove method existed on the Extensions list. In my previous change I've already tried making it generic but I have failed and judging by your code it seems that I forgot to make mine + 'static. I've tested it out locally and it seems to work.

I've gone ahead and fixed the small issue you had in it (in order to remove the extension the reference needs to be accessed as mut) as well as the wrong import path.