Code Room
Code reviewMedium
Question
Review this Rust function that talks to a service over a TCP stream.
What a strong answer looks like
Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix — specific and kind.
Learn the concepts
use std::net::TcpStream;use std::io::{Write, Read}; fn rpc(req: &[u8]) -> std::io::Result<Vec<u8>> { let mut s = TcpStream::connect("svc.internal:9000")?; s.write_all(req)?; let mut buf = Vec::new(); s.read_to_end(&mut buf)?; Ok(buf)}Run or narrate your approach, then ask the coach.