Skip to content
Snippets Groups Projects
Verified Commit 9063d349 authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Fix some small rusty issues

parent 5ca3295d
No related branches found
No related tags found
No related merge requests found
...@@ -18,7 +18,7 @@ extern crate config; ...@@ -18,7 +18,7 @@ extern crate config;
fn load_config(config_file: String) -> config::Config { fn load_config(config_file: String) -> config::Config {
let mut conf = config::Config::default(); let mut conf = config::Config::default();
conf.set("pam.flow", "password"); conf.set("pam.flow", "password").ok();
conf conf
.merge(config::File::with_name(&config_file)).unwrap() .merge(config::File::with_name(&config_file)).unwrap()
...@@ -48,9 +48,9 @@ pub fn argv_to_config(argv: &Vec<String>) -> config::Config { ...@@ -48,9 +48,9 @@ pub fn argv_to_config(argv: &Vec<String>) -> config::Config {
for arg in argv { for arg in argv {
if arg.contains("=") { if arg.contains("=") {
let split: Vec<&str> = arg.split("=").collect(); let split: Vec<&str> = arg.split("=").collect();
conf.set(split[0], split[1]); conf.set(split[0], split[1]).ok();
} else { } else {
conf.set(arg, true); conf.set(arg, true).ok();
} }
} }
return conf; return conf;
......
...@@ -46,7 +46,7 @@ fn get_or_pam_error(config: &Config, key: &str) -> Result<String, PamError> { ...@@ -46,7 +46,7 @@ fn get_or_pam_error(config: &Config, key: &str) -> Result<String, PamError> {
debug!("Configuration key found: {} = {}", key, v); debug!("Configuration key found: {} = {}", key, v);
return Ok(v); return Ok(v);
}, },
_ => { Err(_) => {
error!("Configuration key not found: {}", key); error!("Configuration key not found: {}", key);
return Err(PamError::SERVICE_ERR); return Err(PamError::SERVICE_ERR);
}, },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment