Skip to content

Commit e7b3966

Browse files
authored
fix(server): add must_use to Connection future types (#178)
1 parent 4c4e062 commit e7b3966

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/server/conn/auto/mod.rs

+12-2
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,12 @@ where
318318
}
319319

320320
pin_project! {
321-
/// Connection future.
321+
/// A [`Future`](core::future::Future) representing an HTTP/1 connection, returned from
322+
/// [`Builder::serve_connection`](struct.Builder.html#method.serve_connection).
323+
///
324+
/// To drive HTTP on this connection this future **must be polled**, typically with
325+
/// `.await`. If it isn't polled, no progress will be made on this connection.
326+
#[must_use = "futures do nothing unless polled"]
322327
pub struct Connection<'a, I, S, E>
323328
where
324329
S: HttpService<Incoming>,
@@ -490,7 +495,12 @@ where
490495
}
491496

492497
pin_project! {
493-
/// Connection future.
498+
/// An upgradable [`Connection`], returned by
499+
/// [`Builder::serve_upgradable_connection`](struct.Builder.html#method.serve_connection_with_upgrades).
500+
///
501+
/// To drive HTTP on this connection this future **must be polled**, typically with
502+
/// `.await`. If it isn't polled, no progress will be made on this connection.
503+
#[must_use = "futures do nothing unless polled"]
494504
pub struct UpgradeableConnection<'a, I, S, E>
495505
where
496506
S: HttpService<Incoming>,

0 commit comments

Comments
 (0)