Not heap allocating an Error anymore

This commit is contained in:
Beefki 2017-10-26 00:34:04 -05:00
parent df54495c20
commit 45eeb69bda

View File

@ -4,7 +4,6 @@ use std::io::prelude::*;
use std::fs::{self, File}; use std::fs::{self, File};
use std::env; use std::env;
use super::std; use super::std;
use std::error::Error;
/// Creates a `PackageManager` struct to hold in the needed data /// Creates a `PackageManager` struct to hold in the needed data
/// to run our commands. /// to run our commands.
@ -119,7 +118,7 @@ impl<'a> PackageManager<'a> {
/// Pulls the first line out of the default.conf and loads that. /// Pulls the first line out of the default.conf and loads that.
/// If it doesn't recognize the file it will tell the user that there's an /// If it doesn't recognize the file it will tell the user that there's an
/// issue before exiting. /// issue before exiting.
pub fn read_default<'a, P: AsRef<Path>>(ruxconf: P) -> Result<PackageManager<'a>, Box<Error>> { pub fn read_default<'a, P: AsRef<Path>>(ruxconf: P) -> Result<PackageManager<'a>, std::io::Error> {
/* /*
let mut home = env::home_dir().unwrap_or_else(|| { let mut home = env::home_dir().unwrap_or_else(|| {
eprintln!("Cannot load file, home directory cannot be found"); eprintln!("Cannot load file, home directory cannot be found");