From d782f76a4c11607b9ba1fc58c78a5bb7082092db Mon Sep 17 00:00:00 2001 From: tottoto Date: Wed, 7 Aug 2024 00:39:47 +0900 Subject: [PATCH] feat(util): add const constructor for empty Full --- http-body-util/src/full.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/http-body-util/src/full.rs b/http-body-util/src/full.rs index 30f0c6a..7ef28c1 100644 --- a/http-body-util/src/full.rs +++ b/http-body-util/src/full.rs @@ -18,6 +18,11 @@ impl Full where D: Buf, { + /// Create a new empty `Full`. + pub const fn empty() -> Self { + Full { data: None } + } + /// Create a new `Full`. pub fn new(data: D) -> Self { let data = if data.has_remaining() {