forked from actix/actix-web
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove implementation of Responder for (). Fixes actix#1108.
Rationale: - In Rust, one can omit a semicolon after a function's final expression to make its value the function's return value. It's common for people to include a semicolon after the last expression by mistake - common enough that the Rust compiler suggests removing the semicolon when there's a type mismatch between the function's signature and body. By implementing Responder for (), Actix makes this common mistake a silent error in handler functions. - Functions returning an empty body should return HTTP status 204 ("No Content"), so the current Responder impl for (), which returns status 200 ("OK"), is not really what one wants anyway. - It's not much of a burden to ask handlers to explicitly return `HttpResponse::Ok()` if that is what they want; all the examples in the documentation do this already.
- Loading branch information
Showing
6 changed files
with
20 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters