Code Room
Code reviewHard
Question
Review this Rust code building a fixed config struct via MaybeUninit to skip a Default.
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::mem::MaybeUninit;struct Config { host: String, port: u16, retries: u32 } fn build(host: String, port: u16) -> Config { let mut c = MaybeUninit::<Config>::uninit(); let p = c.as_mut_ptr(); unsafe { (*p).host = host; // (1) (*p).port = port; c.assume_init() // retries never set }}Run or narrate your approach, then ask the coach.