Refactor project to start making a little more sense

This commit is contained in:
Lucien Greathouse
2019-06-12 15:11:19 -07:00
parent c77c754f6d
commit 90516e035d
6 changed files with 89 additions and 60 deletions

View File

@@ -7,7 +7,7 @@ use log::info;
use failure::Fail;
use crate::{
project::{Project, ProjectLoadFuzzyError},
project::{Project, ProjectLoadError},
web::LiveServer,
imfs::FsError,
live_session::{LiveSession, LiveSessionError},
@@ -24,7 +24,7 @@ pub struct ServeOptions {
#[derive(Debug, Fail)]
pub enum ServeError {
#[fail(display = "Project load error: {}", _0)]
ProjectLoadError(#[fail(cause)] ProjectLoadFuzzyError),
ProjectLoadError(#[fail(cause)] ProjectLoadError),
#[fail(display = "{}", _0)]
FsError(#[fail(cause)] FsError),
@@ -34,7 +34,7 @@ pub enum ServeError {
}
impl_from!(ServeError {
ProjectLoadFuzzyError => ProjectLoadError,
ProjectLoadError => ProjectLoadError,
FsError => FsError,
LiveSessionError => LiveSessionError,
});
@@ -43,7 +43,6 @@ pub fn serve(options: &ServeOptions) -> Result<(), ServeError> {
info!("Looking for project at {}", options.fuzzy_project_path.display());
let project = Arc::new(Project::load_fuzzy(&options.fuzzy_project_path)?);
project.check_compatibility();
info!("Found project at {}", project.file_location.display());
info!("Using project {:#?}", project);