From 449fce2fe020a7ca2df9bccaad9de1cd98823dd9 Mon Sep 17 00:00:00 2001 From: jakubmanczak Date: Sun, 14 Jul 2024 11:18:58 +0200 Subject: [PATCH] add teapot response body --- src/routes/teapot.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/routes/teapot.rs b/src/routes/teapot.rs index ac20dd5..e7d9ad3 100644 --- a/src/routes/teapot.rs +++ b/src/routes/teapot.rs @@ -6,6 +6,8 @@ pub fn route() -> Router { .route("/brew", get(refuse_to_brew_coffee())) } -fn refuse_to_brew_coffee() -> StatusCode { - StatusCode::IM_A_TEAPOT +static TEAPOT_RESPONSE: &str = "I'm a teapot."; + +fn refuse_to_brew_coffee() -> (StatusCode, &'static str) { + (StatusCode::IM_A_TEAPOT, TEAPOT_RESPONSE) }