Browse Source

Do not duplicate defaults

Signed-off-by: Alexey Yerin <yerinalexey98fd@gmail.com>
master
Alexey Yerin 4 years ago committed by Garrit Franke
parent
commit
80455fe1e5
  1. 4
      src/config.rs
  2. 2
      src/main.rs

4
src/config.rs

@ -13,9 +13,7 @@ pub struct Config {
}
impl Config {
pub fn load(config_path: Option<String>) -> anyhow::Result<Self> {
let config_path = config_path.unwrap_or_else(|| "/etc/taurus/taurus.toml".to_owned());
pub fn load(config_path: &str) -> anyhow::Result<Self> {
let mut file = fs::File::open(config_path)?;
let mut contents = String::new();

2
src/main.rs

@ -41,7 +41,7 @@ fn run() -> Result<(), error::TaurusError> {
)
.get_matches();
let config_path = matches.value_of("config").map(|v| v.to_owned());
let config_path = matches.value_of("config").unwrap();
let config: config::Config =
config::Config::load(config_path).map_err(error::TaurusError::InvalidConfig)?;

Loading…
Cancel
Save