Skip to content

Commit 113ced5

Browse files
Test Userclaude
andcommitted
fix(clippy): flatten manual_flatten in server_http_error test Fixes #2133
Replace `for stream in incoming() { if let Ok(s) = stream { ... } }` with `for s in incoming().flatten() { ... }` to satisfy clippy::manual_flatten. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 65756a5 commit 113ced5

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

crates/terraphim_agent/tests/exit_codes.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -167,14 +167,12 @@ fn server_http_error_exits_1() {
167167
let port = listener.local_addr().unwrap().port();
168168

169169
std::thread::spawn(move || {
170-
for stream in listener.incoming() {
171-
if let Ok(mut s) = stream {
172-
let mut buf = [0u8; 2048];
173-
let _ = std::io::Read::read(&mut s, &mut buf);
174-
let _ = s.write_all(
175-
b"HTTP/1.1 400 Bad Request\r\nContent-Length: 0\r\nConnection: close\r\n\r\n",
176-
);
177-
}
170+
for mut s in listener.incoming().flatten() {
171+
let mut buf = [0u8; 2048];
172+
let _ = std::io::Read::read(&mut s, &mut buf);
173+
let _ = s.write_all(
174+
b"HTTP/1.1 400 Bad Request\r\nContent-Length: 0\r\nConnection: close\r\n\r\n",
175+
);
178176
}
179177
});
180178

0 commit comments

Comments
 (0)