From 2388401e13ed7e7c9be4c5a2c5e2c668015cdb19 Mon Sep 17 00:00:00 2001 From: ddidderr Date: Sun, 21 Dec 2025 13:31:51 +0100 Subject: [PATCH] clippy: fix lints in tests --- crates/pfs-tftp/tests/integration.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/crates/pfs-tftp/tests/integration.rs b/crates/pfs-tftp/tests/integration.rs index fb50b8e..92ceffa 100644 --- a/crates/pfs-tftp/tests/integration.rs +++ b/crates/pfs-tftp/tests/integration.rs @@ -159,7 +159,9 @@ fn test_get_exact_block_size() { fn test_get_large_file() { let ctx = TestContext::new(false); // Multi-block file: 2.5 blocks - let content: Vec = (0..1280).map(|i| (i % 256) as u8).collect(); + //#[allow(clippy::cast_sign_loss)] + #[allow(clippy::cast_possible_truncation)] + let content: Vec = (0u16..1280).map(|i| (i % 256) as u8).collect(); ctx.create_server_file("large.bin", &content); let client = ctx.client(); @@ -188,7 +190,7 @@ fn test_get_file_not_found() { let result = client.get("nonexistent.txt", Mode::Octet); assert!(result.is_err()); - let err = result.unwrap_err(); + let err = result.expect_err("Expected Not found error, but instead got Ok result"); assert!(err.to_string().contains("not found") || err.to_string().contains("Remote error")); } @@ -213,7 +215,8 @@ fn test_put_small_file() { fn test_put_large_file() { let ctx = TestContext::new(true); // Multi-block file - let content: Vec = (0..2000).map(|i| (i % 256) as u8).collect(); + #[allow(clippy::cast_possible_truncation)] + let content: Vec = (0u16..2000).map(|i| (i % 256) as u8).collect(); let client = ctx.client(); client