-
Notifications
You must be signed in to change notification settings - Fork 227
Permalink
Choose a base ref
{{ refName }}
default
Choose a head ref
{{ refName }}
default
Comparing changes
Choose two branches to see what’s changed or to start a new pull request.
If you need to, you can also or
learn more about diff comparisons.
Open a pull request
Create a new pull request by comparing changes across two branches. If you need to, you can also .
Learn more about diff comparisons here.
base repository: rust-cli/config-rs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.15.10
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
...
head repository: rust-cli/config-rs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.15.11
Could not load branches
Nothing to show
Loading
Could not load tags
Nothing to show
{{ refName }}
default
Loading
- 5 commits
- 5 files changed
- 2 contributors
Commits on Mar 12, 2025
-
Configuration menu - View commit details
-
Copy full SHA for 6ca539c - Browse repository at this point
Copy the full SHA 6ca539cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1ecc731 - Browse repository at this point
Copy the full SHA 1ecc731View commit details -
feat: Add support for float and boolean hash keys (#650)
The `unreachable!` code at https://github.com/rust-cli/config-rs/blob/main/src/file/format/yaml.rs#L53 is reachable, and this PR fixes it for two simple types: reals and booleans. Prior to this change you'd get this error trying to parse the following: ``` thread '...' panicked at .../config-0.15.9/src/file/format/yaml.rs:53:26: internal error: entered unreachable code ``` The problematic case for me turned out to be float keys: ```yaml inner_float: 0.1: "float 0.1" 0.2: "float 0.2" ``` The change in this PR follows the same pattern as already exists for Strings and Integers - just parse them as strings and leave it up to the user to work out what to do with that. Personally I only need the Real support, so happy to remove the Boolean case if that's at all contentious. I decided not to look into whether you can craft a hash with the other Yaml types (below) because it's such an odd use case it didn't seam realistic! That said, #547 suggests that just treating Hash as string would have avoided that users' problem. However, converting from these types back into the exact string format they were parsed in would be difficult, so it's not clear what the right implementation would be. So getting the simpler case (reals, booleans) done feels like the right sized change to make. ``` Array(Array), Hash(Hash), Alias(usize), Null, BadValue, ``` Let me know what you think! And thanks for maintaining this useful crate :)
Configuration menu - View commit details
-
Copy full SHA for aadd8c8 - Browse repository at this point
Copy the full SHA aadd8c8View commit details -
Configuration menu - View commit details
-
Copy full SHA for e57efa2 - Browse repository at this point
Copy the full SHA e57efa2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 532ab4d - Browse repository at this point
Copy the full SHA 532ab4dView commit details
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.