Skip to content

Commit

Permalink
feat(util): allow Empty constructor in const context
Browse files Browse the repository at this point in the history
  • Loading branch information
tottoto committed Sep 6, 2024
1 parent 69e80eb commit 36d97ee
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions http-body-util/src/empty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ pub struct Empty<D> {

impl<D> Empty<D> {
/// Create a new `Empty`.
pub fn new() -> Self {
Self::default()
pub const fn new() -> Self {
Self {
_marker: PhantomData,
}
}
}

Expand Down Expand Up @@ -49,9 +51,7 @@ impl<D> fmt::Debug for Empty<D> {

impl<D> Default for Empty<D> {
fn default() -> Self {
Self {
_marker: PhantomData,
}
Self::new()
}
}

Expand Down

0 comments on commit 36d97ee

Please sign in to comment.