Code Room
Code reviewMedium
Question
Review this Rust function that builds and reuses a connection config.
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
struct Config { endpoints: Vec<String> } fn dial(cfg: Config) -> std::io::Result<()> { // pretend this connects using the config Ok(())} fn run() -> std::io::Result<()> { let cfg = Config { endpoints: vec!["a:80".into(), "b:80".into()] }; for attempt in 0..3 { println!("attempt {attempt}"); dial(cfg)?; } Ok(())}Run or narrate your approach, then ask the coach.