Repository: starship/starship
File: src/configs/starship_root.rs (Rust)

Code before:
            config.iter().for_each(|(k, v)| match k.as_str() {
                "format" => self.format.load_config(v),
                "scan_timeout" => self.scan_timeout.load_config(v),
                "command_timeout" => self.command_timeout.load_config(v),
                "add_newline" => self.add_newline.load_config(v),
                unknown => {
                    if !ALL_MODULES.contains(&unknown) && unknown != "custom" {
                        log::warn!("Unknown config key '{}'", unknown);

                        let did_you_mean = &[
                            // Root options
                            "format",
                            "scan_timeout",
                            "command_timeout",
                            "add_newline",
                            // Modules
                            "custom",
                        ]
                        .iter()
                        .chain(ALL_MODULES.iter())
                        .filter_map(|field| {
                            let score = strsim::jaro_winkler(unknown, field);
                            (score > 0.8).then(|| (score, field))
                        })
                        .max_by(
                            |(score_a, _field_a), (score_b, _field_d)| {
                                score_a.partial_cmp(score_b).unwrap_or(Ordering::Equal)
                            },
                        );

                        if let Some((_score, field)) = did_you_mean {
                            log::warn!("Did you mean '{}'?", field);
                        }
                    }
                }
            });
        }
    }

    fn from_config(config: &'a toml::Value) -> Option<Self> {
        let mut out = Self::default();
        out.load_config(config);
        Some(out)
    }
}


Review comment (suggestion):
Don't think this changes anything since it is not used but for should this be 
```suggestion
                            |(score_a, _field_a), (score_b, _field_b)| {
```


Code after:
            config.iter().for_each(|(k, v)| match k.as_str() {
                "format" => self.format.load_config(v),
                "scan_timeout" => self.scan_timeout.load_config(v),
                "command_timeout" => self.command_timeout.load_config(v),
                "add_newline" => self.add_newline.load_config(v),
                unknown => {
                    if !ALL_MODULES.contains(&unknown) && unknown != "custom" {
                        log::warn!("Unknown config key '{}'", unknown);

                        let did_you_mean = &[
                            // Root options
                            "format",
                            "scan_timeout",
                            "command_timeout",
                            "add_newline",
                            // Modules
                            "custom",
                        ]
                        .iter()
                        .chain(ALL_MODULES.iter())
                        .filter_map(|field| {
                            let score = strsim::jaro_winkler(unknown, field);
                            (score > 0.8).then(|| (score, field))
                        })
                        .max_by(
                            |(score_a, _field_a), (score_b, _field_b)| {
                                score_a.partial_cmp(score_b).unwrap_or(Ordering::Equal)
                            },
                        );

                        if let Some((_score, field)) = did_you_mean {
                            log::warn!("Did you mean '{}'?", field);
                        }
                    }
                }
            });
        }
    }

    fn from_config(config: &'a toml::Value) -> Option<Self> {
        let mut out = Self::default();
        out.load_config(config);
        Some(out)
    }
}