Use anyhow

This commit is contained in:
Dheepak Krishnamurthy 2021-03-27 14:46:06 -06:00
parent 66a26b88d0
commit bf0fb46f90
7 changed files with 36 additions and 22 deletions

View file

@ -1,3 +1,4 @@
use anyhow::Result;
use std::collections::HashMap;
use std::error::Error;
use std::process::Command;
@ -58,7 +59,7 @@ pub struct Config {
}
impl Config {
pub fn default() -> Result<Self, Box<dyn Error>> {
pub fn default() -> Result<Self> {
let bool_collection = Self::get_bool_collection();
Ok(Self {
enabled: true,
@ -105,7 +106,7 @@ impl Config {
Some(Self::get_tcolor(&s))
}
fn get_color_collection() -> Result<HashMap<String, Style>, Box<dyn Error>> {
fn get_color_collection() -> Result<HashMap<String, Style>> {
let mut color_collection = HashMap::new();
let output = Command::new("task").arg("rc.color=off").arg("show").output()?;