Remove unecessary .to_string
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
notplants 2022-05-11 11:24:33 +02:00
parent 97680f9010
commit b84e470a42
1 changed files with 24 additions and 25 deletions

View File

@ -41,34 +41,33 @@ lazy_static! {
// Default values for PeachCloud configs which are used for any key which is not set
// via an environment variable or in a saved configuration file.
pub fn get_peach_config_defaults() -> HashMap<String, String> {
let peach_config_defaults: HashMap<String, String> = HashMap::from([
("STANDALONE_MODE".to_string(), "true".to_string()),
("DISABLE_AUTH".to_string(), "false".to_string()),
("ADDR".to_string(), "127.0.0.1".to_string()),
("PORT".to_string(), "8000".to_string()),
("EXTERNAL_DOMAIN".to_string(), "".to_string()),
("DYN_DOMAIN".to_string(), "".to_string()),
let peach_config_defaults: HashMap<&str, &str> = HashMap::from([
("STANDALONE_MODE", "true"),
("DISABLE_AUTH", "false"),
("ADDR", "127.0.0.1"),
("PORT", "8000"),
("EXTERNAL_DOMAIN", ""),
("DYN_DOMAIN", ""),
(
"DYN_DNS_SERVER_ADDRESS".to_string(),
"http://dynserver.dyn.peachcloud.org".to_string(),
),
("DYN_USE_CUSTOM_SERVER".to_string(), "true".to_string()),
("DYN_TSIG_KEY_PATH".to_string(), "".to_string()),
(
"DYN_NAMESERVER".to_string(),
"ns.peachcloud.org".to_string(),
),
("DYN_ENABLED".to_string(), "false".to_string()),
("SSB_ADMIN_IDS".to_string(), "".to_string()),
("ADMIN_PASSWORD_HASH".to_string(), "146".to_string()),
("TEMPORARY_PASSWORD_HASH".to_string(), "".to_string()),
("GO_SBOT_DATADIR".to_string(), "".to_string()),
(
"PEACH_CONFIGDIR".to_string(),
"/var/lib/peachcloud".to_string(),
"DYN_DNS_SERVER_ADDRESS",
"http://dynserver.dyn.peachcloud.org",
),
("DYN_USE_CUSTOM_SERVER", "true"),
("DYN_TSIG_KEY_PATH", ""),
("DYN_NAMESERVER", "ns.peachcloud.org"),
("DYN_ENABLED", "false"),
("SSB_ADMIN_IDS", ""),
("ADMIN_PASSWORD_HASH", "146"),
("TEMPORARY_PASSWORD_HASH", ""),
("GO_SBOT_DATADIR", ""),
("PEACH_CONFIGDIR", "/var/lib/peachcloud"),
]);
peach_config_defaults
// convert HashMap<&str, &str> to HashMap<String, String> and return
let pc_defaults: HashMap<String, String> = peach_config_defaults
.iter()
.map(|(key, val)| (key.to_string(), val.to_string()))
.collect();
pc_defaults
}
// primary interface for getting config values