oxur/twyg: 0.6.3 - Support Partial Configs
Authors/Creators
Description
Overview
Version 0.6.3 is a bug fix release addressing an issue where twyg::Opts required all fields to be present during deserialization, making it impractical to use in partial TOML/YAML/JSON configurations. Users can now specify only the fields they want to override and rely on defaults for the rest. This release also relaxes version specifiers for some dependencies.
Bug Fixes
Partial Deserialization of Opts (Closes #7)
Issue: When embedding twyg::Opts directly in an application config struct, users were forced to specify every field in their configuration file. A minimal config like:
[logging]
level = "debug"
Would fail with:
TOML parse error at line 3, column 1
|
3 | [logging]
| ^^^^^^^^^
missing field `coloured`
Root Cause: Four fields on the Opts struct (coloured, output, level, report_caller) were missing #[serde(default)] attributes, while the remaining seven fields already had them.
Solution: Added #[serde(default)] to the four missing fields. All four types already implement Default with values matching Opts::default():
coloured: bool-- defaults tofalseoutput: Output-- defaults toOutput::Stdoutlevel: LogLevel-- defaults toLogLevel::Errorreport_caller: bool-- defaults tofalse
Impact: Users can now embed twyg::Opts in their config structs and provide minimal configurations, specifying only the fields they want to override.
Files Changed:
src/opts.rs-- Added#[serde(default)]to 4 fields, added unit testtests/integration_tests.rs-- Added integration test for partial TOML deserialization
Dependencies
Version Specifier Cleanup
Relaxed version specifiers for two dependencies to follow standard semver conventions:
thiserror:"2.0"->"2"(resolved: 2.0.18)anyhow(dev):"1.0.100"->"1"(resolved: 1.0.101)
Lockfile Updates
Updated transitive dependencies via Cargo.lock:
chrono: 0.4.42 -> 0.4.43thiserror: 2.0.17 -> 2.0.18anyhow: 1.0.100 -> 1.0.101- Various other transitive dependency updates (wasm-bindgen, windows-core, etc.)
Backward Compatibility
This release maintains full backward compatibility with 0.6.2:
- No API changes
- No breaking changes
- Existing configurations continue to work
- Fixes only enhance existing functionality
Installation
[dependencies]
twyg = "0.6.3"
Or update existing installations:
cargo update twyg
Full Changelog: https://github.com/oxur/twyg/compare/0.6.2...0.6.3
Files
oxur/twyg-0.6.3.zip
Files
(1.1 MB)
| Name | Size | Download all |
|---|---|---|
|
md5:6e4f13d9d724e267af19344addb4ce31
|
1.1 MB | Preview Download |
Additional details
Related works
- Is supplement to
- Software: https://github.com/oxur/twyg/tree/0.6.3 (URL)
Software
- Repository URL
- https://github.com/oxur/twyg