-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reading HashMap from empty json fails with type error. #624
Comments
This seems to happen every time a value is initialized from an empty use config::Config;
use std::collections::HashMap;
fn main() {
let config = Config::builder().set_default("var", HashMap::<String, i64>::new()).unwrap().build().unwrap();
// returns empty HashMap on 0.14.*/0.15.2, Errs on "invalid type: unit value, expected a map" on 0.15.3/0.15.4
let val : HashMap<String, i64> = config.get("var").unwrap();
println!("Hello, world! {:?}", val);
} |
I'm stumbling over this as well. Also happens with structs where all fields are |
Encountered this issue as well. Appears to be a regression, it worked with 0.15.2, but fails with 0.15.3 and 0.15.4. |
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
version: 0.15.4
Config fails to initialize (an empty) HashMap from an empty object.
Repro:
Expected behavior: data is initialized to an empty HashMap.
Actual result:
Err( invalid type: unit value, expected a map )
The text was updated successfully, but these errors were encountered: