Skip to content

Commit efb8ec4

Browse files
authored
api: impl Default for Box<BStr>
PR #206
1 parent cbe2c69 commit efb8ec4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/impls.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -765,6 +765,14 @@ mod bstr {
765765
}
766766
}
767767

768+
#[cfg(feature = "alloc")]
769+
impl Default for Box<BStr> {
770+
#[inline]
771+
fn default() -> Self {
772+
BStr::from_boxed_bytes(Box::default())
773+
}
774+
}
775+
768776
impl<'a, const N: usize> From<&'a [u8; N]> for &'a BStr {
769777
#[inline]
770778
fn from(s: &'a [u8; N]) -> &'a BStr {

0 commit comments

Comments
 (0)