mirror of
https://github.com/kdheepak/taskwarrior-tui.git
synced 2025-08-26 03:07:18 +02:00
Use anyhow
This commit is contained in:
parent
66a26b88d0
commit
bf0fb46f90
7 changed files with 36 additions and 22 deletions
|
@ -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()?;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue