Skip to content

Commit 09e80cf

Browse files
MagicalTuxclaude
andcommitted
Fix CI: move h2 response_fields before its test module; qualify TlsStream doc link
- clippy::items_after_test_module: h2/conn.rs declared response_fields after the #[cfg(test)] mod, which `cargo clippy --all-targets -D warnings` rejects. - rustdoc broken-intra-doc-link: session.rs `[`TlsStream`]` now points at crate::tls::TlsStream (it isn't in scope at that doc site). Verified with the exact CI commands: clippy --all-targets --all-features -D warnings and RUSTDOCFLAGS=-D warnings cargo doc --all-features both pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 3adbca0 commit 09e80cf

2 files changed

Lines changed: 12 additions & 15 deletions

File tree

src/h2/conn.rs

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,15 @@ impl H2Conn {
568568
}
569569
}
570570

571+
/// Build the HPACK field list for a response from the shared response-header
572+
/// rules (`:status` first, hop-by-hop dropped, `server` defaulted).
573+
fn response_fields(status: StatusCode, headers: &Headers, server: Option<&str>) -> Vec<HeaderField> {
574+
crate::proto::response_fields(status, headers, server)
575+
.iter()
576+
.map(|(n, v)| HeaderField::new(n, v))
577+
.collect()
578+
}
579+
571580
#[cfg(test)]
572581
mod tests {
573582
use super::*;
@@ -684,16 +693,3 @@ mod tests {
684693
assert!(c.wants_close());
685694
}
686695
}
687-
688-
/// Build the HPACK field list for a response from the shared response-header
689-
/// rules (`:status` first, hop-by-hop dropped, `server` defaulted).
690-
fn response_fields(
691-
status: StatusCode,
692-
headers: &Headers,
693-
server: Option<&str>,
694-
) -> Vec<HeaderField> {
695-
crate::proto::response_fields(status, headers, server)
696-
.iter()
697-
.map(|(n, v)| HeaderField::new(n, v))
698-
.collect()
699-
}

src/session.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,9 @@ impl Session {
132132
}
133133
}
134134

135-
/// Create a TLS (HTTPS) session wrapping an accepted [`TlsStream`]. The
136-
/// protocol (HTTP/1.1 or HTTP/2) is chosen once ALPN is known.
135+
/// Create a TLS (HTTPS) session wrapping an accepted
136+
/// [`TlsStream`](crate::tls::TlsStream). The protocol (HTTP/1.1 or HTTP/2)
137+
/// is chosen once ALPN is known.
137138
#[cfg(feature = "tls")]
138139
pub fn tls(cfg: SessionConfig, stream: crate::tls::TlsStream) -> Session {
139140
Session {

0 commit comments

Comments
 (0)