Keep a test's doc comment attached to its test

Adding the test_auth helper put it between
`/// The URL shape confirmed from a real H2C's ipcam block.` and the test
that comment describes, so the comment documented the helper instead.
Clippy's empty_line_after_doc_comments caught it. Also takes clippy's
from_ref over a clone in the new render-stability test.
This commit is contained in:
2026-10-18 22:01:21 +00:00
parent 70763108f8
commit d13284b585
+3 -3
View File
@@ -379,14 +379,14 @@ mod tests {
)) ))
} }
/// The URL shape confirmed from a real H2C's `ipcam` block.
/// A fixed credential, so the byte-identical assertions below stay /// A fixed credential, so the byte-identical assertions below stay
/// meaningful. A real one is 32 random bytes and would make every /// meaningful. A real one is 32 random bytes and would make every
/// rendered config differ from every other. /// rendered config differ from every other.
fn test_auth() -> ApiAuth { fn test_auth() -> ApiAuth {
ApiAuth { username: "continuum".into(), password: "test-password".into() } ApiAuth { username: "continuum".into(), password: "test-password".into() }
} }
/// The URL shape confirmed from a real H2C's `ipcam` block.
#[test] #[test]
fn a_reported_rtsps_url_gets_the_printer_credentials_spliced_in() { fn a_reported_rtsps_url_gets_the_printer_credentials_spliced_in() {
let source = source_for(&printer("h2c"), Some("rtsps://192.168.0.21:322/streaming/live/1")) let source = source_for(&printer("h2c"), Some("rtsps://192.168.0.21:322/streaming/live/1"))
@@ -506,7 +506,7 @@ mod tests {
fn the_same_fleet_and_credential_render_identically() { fn the_same_fleet_and_credential_render_identically() {
let source = CameraSource { stream_name: "h2c".into(), url: "rtsps://x".into() }; let source = CameraSource { stream_name: "h2c".into(), url: "rtsps://x".into() };
assert_eq!( assert_eq!(
render_config(":1984", &[source.clone()], &test_auth()), render_config(":1984", std::slice::from_ref(&source), &test_auth()),
render_config(":1984", &[source], &test_auth()), render_config(":1984", &[source], &test_auth()),
); );
} }