Skip to content

Commit 9e74ff9

Browse files
authored
Document tls example with compilation instruction (#896)
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.
1 parent ab15738 commit 9e74ff9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

examples/tls.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

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

0 commit comments

Comments
 (0)