Skip to content

Commit 13bec83

Browse files
committed
feat: expose ::new for Extensions, Header, and Values
based on: https://github.com/http-rs/http-types/pull/320/files by @jbr
1 parent c968ba3 commit 13bec83

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/extensions.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub struct Extensions {
2121
impl Extensions {
2222
/// Create an empty `Extensions`.
2323
#[inline]
24-
pub(crate) fn new() -> Self {
24+
pub fn new() -> Self {
2525
Self { map: None }
2626
}
2727

src/headers/headers.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub struct Headers {
3232

3333
impl Headers {
3434
/// Create a new instance.
35-
pub(crate) fn new() -> Self {
35+
pub fn new() -> Self {
3636
Self { headers: HashMap::new() }
3737
}
3838

src/headers/values.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub struct Values<'a> {
1313

1414
impl<'a> Values<'a> {
1515
/// Constructor for `Headers`.
16-
pub(crate) fn new(inner: hash_map::Values<'a, HeaderName, HeaderValues>) -> Self {
16+
pub fn new(inner: hash_map::Values<'a, HeaderName, HeaderValues>) -> Self {
1717
Self {
1818
inner: Some(inner),
1919
slot: None,
@@ -22,7 +22,7 @@ impl<'a> Values<'a> {
2222
}
2323

2424
/// Constructor for `HeaderValues`.
25-
pub(crate) fn new_values(values: &'a HeaderValues) -> Self {
25+
pub fn new_values(values: &'a HeaderValues) -> Self {
2626
Self {
2727
inner: None,
2828
slot: Some(values),

0 commit comments

Comments
 (0)