/// Create a manager from a configuration.
Create a manager from a configuration.
Create a manager from a configuration .
pub fn new_from_config(config: &Config) -> Result<Self, Box<dyn Error>> {
    let path = config.tasks_path();
    if path.is_file() {
      Ok(json::from_reader(fs::File::open(path)?)?)
    } else {
      let task_mgr = TaskManager {
        next_uid: UID::default(),
        tasks: HashMap::new(),
      };
      Ok(task_mgr)
    }
  }
pub fn new_from_config ( config : & Config ) -> Result < Self , Box < dyn Error > > { let path = config . tasks_path ( ) ; if path . is_file ( ) { Ok ( json :: from_reader ( fs :: File :: open ( path ) ? ) ? ) } else { let task_mgr = TaskManager { next_uid : UID :: default ( ) , tasks : HashMap :: new ( ) , } ; Ok ( task_mgr ) } }
Create a manager from a configuration.
Create a manager from a configuration .
config
&Config