Skip to content

Commit

Permalink
Document tls example with compilation instruction (#896)
Browse files Browse the repository at this point in the history
It was clear that I didn't need the #[cfg(feature ...)] in order to get
a Server that could respond to .tls(), but I wasn't immediately sure if
just adding the tls feature to the warp dependency (in Cargo.toml) was
enough, or I had to specify some transitive dependency with it, or
something else. And as the feature wasn't enabled, the docs produced
with `cargo doc --workspace` didn't include Server.tls, so I started to
question if the example I was looking at even matched the warp version
I was working with.

Eventually I just tried adding it to the warp dep and it (of course)
just worked, but for the sake of others I reckon a more explicit
pointing in the right direction could be helpful.
  • Loading branch information
bkgood committed Sep 14, 2021
1 parent ab15738 commit 9e74ff9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions examples/tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

// Don't copy this `cfg`, it's only needed because this file is within
// the warp repository.
// Instead, specify the "tls" feature in your warp dependency declaration.
#[cfg(feature = "tls")]
#[tokio::main]
async fn main() {
Expand Down

0 comments on commit 9e74ff9

Please sign in to comment.