From a8f8dec9556b88db03cb8a0855c51555affa37a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iwo=20Strzebo=C5=84ski?= Date: Sun, 18 Oct 2026 22:01:21 +0000 Subject: [PATCH] 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. Co-Authored-By: Claude Opus 5 --- src/camera.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/camera.rs b/src/camera.rs index 444dc8b..d7f02ee 100644 --- a/src/camera.rs +++ b/src/camera.rs @@ -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 /// meaningful. A real one is 32 random bytes and would make every /// rendered config differ from every other. fn test_auth() -> ApiAuth { ApiAuth { username: "continuum".into(), password: "test-password".into() } } + + /// The URL shape confirmed from a real H2C's `ipcam` block. #[test] 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")) @@ -506,7 +506,7 @@ mod tests { fn the_same_fleet_and_credential_render_identically() { let source = CameraSource { stream_name: "h2c".into(), url: "rtsps://x".into() }; 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()), ); }