From da4ea4d4c2fd0b95717e08f1b4caecef6e4aab09 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Wed, 7 Sep 2022 13:52:58 +0200 Subject: [PATCH] Add must_use attribute to Redirect type (#1356) --- axum/src/response/redirect.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/axum/src/response/redirect.rs b/axum/src/response/redirect.rs index e11389e875..4dee5b5c82 100644 --- a/axum/src/response/redirect.rs +++ b/axum/src/response/redirect.rs @@ -19,6 +19,7 @@ use http::{header::LOCATION, HeaderValue, StatusCode}; /// # hyper::Server::bind(&"".parse().unwrap()).serve(app.into_make_service()).await.unwrap(); /// # }; /// ``` +#[must_use = "needs to be returned from a handler or otherwise turned into a Response to be useful"] #[derive(Debug, Clone)] pub struct Redirect { status_code: StatusCode,