mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-16 22:14:30 +00:00
Settings: the legacy file parser has a named type (clippy type_complexity)
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user