Code Room
Code reviewMediumcr-g155
Subject OwnershipLevel Mid–Senior~25 minCommon in Code quality & review interviewsIndustries Software development

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.

Talk through your review
Code to reviewrust
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.