Settings: the legacy file parser has a named type (clippy type_complexity)

This commit is contained in:
aiongg
2026-11-16 01:39:05 +00:00
parent 754e8c4fe7
commit 3f44be022e
+4 -1
View File
@@ -60,9 +60,12 @@ pub struct LegacyFile<T> {
/// store reports them in [`LoadReport::section_errors`](crate::LoadReport::section_errors), the
/// same place a `config.toml` load puts its own. An `Err` means the file is unusable and the
/// next legacy file is tried.
pub parse: fn(&[u8]) -> Result<(T, Vec<SectionError>), String>,
pub parse: ParseLegacy<T>,
}
/// Parses a legacy file's bytes: the value and the values reset to defaults, or why the file is unusable.
pub type ParseLegacy<T> = fn(&[u8]) -> Result<(T, Vec<SectionError>), String>;
/// A legacy file that parsed: its value, the values reset to defaults, and where it was.
pub type Imported<T> = (T, Vec<SectionError>, PathBuf);