aoc-toolkit 0.1.0-alpha.4

A toolkit for solving Advent of Code problems
Documentation
use std::io;
use std::path::PathBuf;

use thiserror::Error;

#[derive(Debug, Error)]
pub enum ProjectError {
    #[error("No aoc.toml found in {start:?} or its ancestors")]
    NotFound { start: PathBuf },

    #[error("Cannot access directory {path:?}: {source}")]
    InvalidStartDirectory {
        path: PathBuf,
        #[source]
        source: io::Error,
    },

    #[error("Path is not a directory: {path:?}")]
    NotDirectory { path: PathBuf },

    #[error("Failed to read configuration {path:?}: {source}")]
    ReadConfig {
        path: PathBuf,
        #[source]
        source: io::Error,
    },

    #[error("Invalid configuration {path:?}: {source}")]
    ParseConfig {
        path: PathBuf,
        #[source]
        source: toml::de::Error,
    },

    #[error(
        "Unsupported configuration schema version: \
         {found}. Expected {expected}."
    )]
    UnsupportedSchemaVersion { found: u32, expected: u32 },
}