Skip to content

Commit

Permalink
feat(util): add const constructor for empty Full
Browse files Browse the repository at this point in the history
  • Loading branch information
tottoto committed Aug 6, 2024
1 parent 69e80eb commit d782f76
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions http-body-util/src/full.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ impl<D> Full<D>
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() {
Expand Down

0 comments on commit d782f76

Please sign in to comment.