From c1d688146956a23366c8e076328bb53351b999b5 Mon Sep 17 00:00:00 2001 From: Owen Jacobson Date: Sun, 24 Aug 2025 03:32:21 -0400 Subject: 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. --- src/empty.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/empty.rs (limited to 'src/empty.rs') 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() + } +} -- cgit v1.2.3