I am using the Preferences crate to save some app configuration data. No matter what value I use for "key" it fails. Not much output to help me understand why. Does anyone know how to make this work?
Code:
use preferences::{AppInfo, PreferencesMap, Preferences};
#[test]
fn save_config_file() {
let APPINFO = AppInfo{name: "preferences", author: ""};
let config_location = "config/solid";
// these values also fail
// let config_location = "config";
// let config_location = "~/config"
let mut data: PreferencesMap<String> = PreferencesMap::new();
data.insert("data_source".to_string(), "memory".to_string());
data.insert("computation".to_string(), "max".to_string());
data.insert("pay_this_amount".to_string(), "13".to_string());
let save_result = data.save(&APPINFO, config_location);
assert!(save_result.is_ok());
}
Error:
panicked at 'assertion failed: save_result.is_ok()'
Thnx
Matt