style: fmt & clippy processed

This commit is contained in:
VC
2022-08-11 12:29:40 +02:00
parent dab8725f99
commit b11595bfca
10 changed files with 297 additions and 209 deletions

View File

@@ -1,5 +1,5 @@
use std::fs::read_to_string;
use serde::Deserialize;
use std::fs::read_to_string;
/// General configuration Struct
#[derive(Debug, Deserialize)]
@@ -35,14 +35,11 @@ pub struct ScootalooConfig {
/// Parses the TOML file into a Config Struct
pub fn parse_toml(toml_file: &str) -> Config {
let toml_config = read_to_string(toml_file).unwrap_or_else(|e|
panic!("Cannot open config file {}: {}", toml_file, e)
);
let toml_config = read_to_string(toml_file)
.unwrap_or_else(|e| panic!("Cannot open config file {}: {}", toml_file, e));
let config: Config = toml::from_str(&toml_config).unwrap_or_else(|e|
panic!("Cannot parse TOML file {}: {}", toml_file, e)
);
let config: Config = toml::from_str(&toml_config)
.unwrap_or_else(|e| panic!("Cannot parse TOML file {}: {}", toml_file, e));
config
}