Skip to content

Commit d9d7e33

Browse files
committed
h1: require constructor
Prevents users from writing `HttpClient {}`.
1 parent 4a1dc82 commit d9d7e33

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/h1.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ use http_types::StatusCode;
77

88
/// Async-h1 based HTTP Client.
99
#[derive(Debug)]
10-
pub struct H1Client {}
10+
pub struct H1Client {
11+
_priv: (),
12+
}
1113

1214
impl Default for H1Client {
1315
fn default() -> Self {
@@ -18,7 +20,7 @@ impl Default for H1Client {
1820
impl H1Client {
1921
/// Create a new instance.
2022
pub fn new() -> Self {
21-
Self {}
23+
Self { _priv: () }
2224
}
2325
}
2426

0 commit comments

Comments
 (0)