mirror of
https://github.com/stoatchat/stoatchat.git
synced 2026-07-14 13:36:59 +00:00
Add a responder for empty responses
This commit is contained in:
@@ -68,8 +68,17 @@ pub enum Error {
|
||||
NoEffect,
|
||||
}
|
||||
|
||||
pub struct EmptyResponse;
|
||||
pub type Result<T, E = Error> = std::result::Result<T, E>;
|
||||
|
||||
impl<'r> Responder<'r> for EmptyResponse {
|
||||
fn respond_to(self, req: &Request) -> response::Result<'r> {
|
||||
Response::build()
|
||||
.status(rocket::http::Status { code: 204 })
|
||||
.ok()
|
||||
}
|
||||
}
|
||||
|
||||
/// HTTP response builder for Error enum
|
||||
impl<'r> Responder<'r, 'static> for Error {
|
||||
fn respond_to(self, _: &'r Request<'_>) -> response::Result<'static> {
|
||||
|
||||
Reference in New Issue
Block a user