summaryrefslogtreecommitdiff
path: root/src/empty.rs
diff options
context:
space:
mode:
authorOwen Jacobson <owen@grimoire.ca>2025-08-24 03:32:21 -0400
committerOwen Jacobson <owen@grimoire.ca>2025-08-24 04:51:24 -0400
commitc1d688146956a23366c8e076328bb53351b999b5 (patch)
tree3ec84ed38448b2179a76241e69a5a2994bf7a2c9 /src/empty.rs
parent53944ef14af4d37c08464cb1bb9f3a8f09277194 (diff)
Define a canonical "empty" response.
This is a bit tidier and easier to assert on than returning a bare HTTP status code, but is otherwise interchangeable with it.
Diffstat (limited to 'src/empty.rs')
-rw-r--r--src/empty.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/empty.rs b/src/empty.rs
new file mode 100644
index 0000000..2c66051
--- /dev/null
+++ b/src/empty.rs
@@ -0,0 +1,11 @@
+use axum::http::StatusCode;
+use axum::response::{IntoResponse, Response};
+
+#[derive(Debug)]
+pub struct Empty;
+
+impl IntoResponse for Empty {
+ fn into_response(self) -> Response {
+ StatusCode::NO_CONTENT.into_response()
+ }
+}