Verified Commit c9ed9e86 authored by Maxime Buquet's avatar Maxime Buquet
Browse files

config example: rustfmt


Signed-off-by: Maxime Buquet's avatarMaxime “pep” Buquet <pep@bouah.net>
parent e56f3996
......@@ -13,9 +13,9 @@ extern crate toml;
extern crate url;
extern crate url_serde;
use url::Url;
use clap::ArgMatches;
use directories::ProjectDirs;
use url::Url;
use std::fs::File;
use std::io::prelude::*;
......@@ -39,7 +39,6 @@ impl From<TimelogError> for Error {
}
}
impl From<std::io::Error> for Error {
fn from(err: std::io::Error) -> Error {
Error::IO(err)
......@@ -76,11 +75,9 @@ pub fn get_config(matches: ArgMatches) -> Result<Config, Error> {
let config_path = match matches.value_of("config") {
Some(path) => PathBuf::from(path),
None => match pdirs {
Some(dirs) => {
dirs.config_dir().join("config.toml")
}
Some(dirs) => dirs.config_dir().join("config.toml"),
None => return Err(Error::Timelog(TimelogError::MissingConfiguration)),
}
},
};
let config_str = read_file(config_path)?;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment