Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
h1: require constructor
Prevents users from writing `HttpClient {}`.
  • Loading branch information
Fishrock123 committed Sep 25, 2020
1 parent 4a1dc82 commit d9d7e33
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/h1.rs
Expand Up @@ -7,7 +7,9 @@ use http_types::StatusCode;

/// Async-h1 based HTTP Client.
#[derive(Debug)]
pub struct H1Client {}
pub struct H1Client {
_priv: (),
}

impl Default for H1Client {
fn default() -> Self {
Expand All @@ -18,7 +20,7 @@ impl Default for H1Client {
impl H1Client {
/// Create a new instance.
pub fn new() -> Self {
Self {}
Self { _priv: () }
}
}

Expand Down

0 comments on commit d9d7e33

Please sign in to comment.