From b807b52cc9c98b4d7e0e16815277fc10cef066fe Mon Sep 17 00:00:00 2001 From: David Pedersen Date: Mon, 27 Dec 2021 19:21:04 +0100 Subject: [PATCH] Make `TypedHeaderRejectionReason` `#[non_exhaustive]` (#665) * Make `TypedHeaderRejectionReason` `#[non_exhaustive]` Fixes https://github.com/tokio-rs/axum/issues/660 * add changelog pr link --- axum/CHANGELOG.md | 2 ++ axum/src/extract/typed_header.rs | 1 + 2 files changed, 3 insertions(+) diff --git a/axum/CHANGELOG.md b/axum/CHANGELOG.md index ca32ba2eb3..ac634c525e 100644 --- a/axum/CHANGELOG.md +++ b/axum/CHANGELOG.md @@ -8,8 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 # Unreleased - **breaking:** Require `Output = ()` on `WebSocketStream::on_upgrade` ([#644]) +- **breaking:** Make `TypedHeaderRejectionReason` `#[non_exhaustive]` ([#665]) [#644]: https://github.com/tokio-rs/axum/pull/644 +[#665]: https://github.com/tokio-rs/axum/pull/665 # 0.4.3 (21. December, 2021) diff --git a/axum/src/extract/typed_header.rs b/axum/src/extract/typed_header.rs index 0151cfe2e4..e5a6f99f8e 100644 --- a/axum/src/extract/typed_header.rs +++ b/axum/src/extract/typed_header.rs @@ -98,6 +98,7 @@ impl TypedHeaderRejection { /// Additional information regarding a [`TypedHeaderRejection`](super::TypedHeaderRejection) #[derive(Debug)] +#[non_exhaustive] pub enum TypedHeaderRejectionReason { /// The header was missing from the HTTP request Missing,