extern crate toml;
use config::Config;
use std::env;
use std::fs::File;
use std::io::Read;

pub struct Workflow {
    config: Config,
}

pub fn new() -> Workflow {
    let config = load_config().unwrap();
    Workflow {
        config: config,
    }
}

fn load_config() -> Result<Config, String> {
    let mut config_file = env::home_dir().unwrap();
    config_file.push(".jiraconfig");
    let mut file = File::open(&config_file).expect("open config file");

    let mut toml_string = String::new();
    file.read_to_string(&mut toml_string).unwrap();

    match toml::from_str(&toml_string) {
        Ok(c) => c,
        Err(_) => Err("Failed load config file".to_string())
    }
}
extern crate toml;
use config::Config;

pub struct Workflow {
    config: Config,
}

pub fn new() -> Workflow {
    let config = load_config();
    Workflow {
        config: config,
    }
}

fn load_config() -> Result<Config, String> {
    let mut config_file: String = env::home_dir().unwrap();
    config_file.push(".jiraconfig");

    match toml::from_str(&config_file) {
        Ok(c) => c,
        Err(_) => Err("Failed load config file")
    }
}
--- 
+++ 
@@ -1,23 +1,30 @@
 extern crate toml;
 use config::Config;
+use std::env;
+use std::fs::File;
+use std::io::Read;
 
 pub struct Workflow {
     config: Config,
 }
 
 pub fn new() -> Workflow {
-    let config = load_config();
+    let config = load_config().unwrap();
     Workflow {
         config: config,
     }
 }
 
 fn load_config() -> Result<Config, String> {
-    let mut config_file: String = env::home_dir().unwrap();
+    let mut config_file = env::home_dir().unwrap();
     config_file.push(".jiraconfig");
+    let mut file = File::open(&config_file).expect("open config file");
 
-    match toml::from_str(&config_file) {
+    let mut toml_string = String::new();
+    file.read_to_string(&mut toml_string).unwrap();
+
+    match toml::from_str(&toml_string) {
         Ok(c) => c,
-        Err(_) => Err("Failed load config file")
+        Err(_) => Err("Failed load config file".to_string())
     }
 }
:sparkles: Make possible to load config file

