toggl 0.3.0

Unofficial command-line interface for Toggl Track using the v9 API.
1
2
3
4
5
6
7
8
9
10
11
12
13
use std::path::Path;
use toml;

use super::model::TrackConfig;

pub fn get_config_from_file<P: AsRef<Path>>(
    path: P,
) -> Result<TrackConfig, Box<dyn std::error::Error>> {
    let contents = std::fs::read_to_string(path)?;
    let config: TrackConfig = toml::from_str(&contents)?;

    Ok(config)
}