protohack

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 5449b1464ac37a553d78ec857619703d6fbacedd
parent 8f0465c71b7b25825e48fa8c50ae915c58af25a2
Author: minerva-jupiter <ryouturn@gmail.com>
Date:   Sat, 21 Mar 2026 21:59:08 +0900

refactor(smoke): use `read_buf` and `write_all` for socket I/O

Diffstat:
A.env | 1+
Msrc/bin/smoke.rs | 4++--
2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/.env b/.env @@ -0,0 +1 @@ +GEMINI_API_KEY=AIzaSyDiW3UJYq8zgpzJxzOPQ35hXoO3RRfrj8s diff --git a/src/bin/smoke.rs b/src/bin/smoke.rs @@ -10,9 +10,9 @@ async fn main() -> std::io::Result<()> { match listener.accept().await { Ok((mut socket, _)) => { let mut buf = Vec::with_capacity(4096); - socket.read(&mut buf).await?; + socket.read_buf(&mut buf).await?; println!("{:?}", buf); - socket.write(&buf).await?; + socket.write_all(&buf).await?; } Err(e) => { return Err(e.into());