Skip to content

Commit

Permalink
feat(util): allow Empty constructor in const context (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
tottoto authored Jan 9, 2025
1 parent fed1452 commit 98d0886
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 98d0886

Please sign in to comment.