mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-23 11:01:59 +01:00
Settings: the legacy file parser has a named type (clippy type_complexity)
This commit is contained in:
1 parent
754e8c4fe7
commit
3f44be022e
1 file changed
+4
-1
@@ -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