aoc-toolkit 0.1.0-alpha.4

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

pub const SCHEMA_VERSION: u32 = 1;

#[derive(Debug, Deserialize)]
pub struct ProjectConfig {
    pub schema_version: u32,
    pub project: ProjectSettings,
    pub runner: RunnerConfig,

    #[serde(default)]
    pub progress: ProgressSettings,
}

#[derive(Debug, Default, Deserialize)]
pub struct ProgressSettings {
    #[serde(default)]
    pub readme: ReadmeSettings,
}

#[derive(Debug, Default, Deserialize)]
pub struct ReadmeSettings {
    #[serde(default)]
    pub enabled: bool,
    pub path: Option<PathBuf>,
    #[serde(default)]
    pub update_on_run: bool,
}

#[derive(Debug, Deserialize)]
pub struct ProjectSettings {
    pub language: Language,
    pub solutions: PathBuf,

    #[serde(default = "default_year_prefix")]
    pub year_prefix: String,
}

fn default_year_prefix() -> String {
    String::new()
}

#[derive(Debug, Deserialize)]
pub struct RunnerConfig {
    pub manifest: PathBuf,
    pub binary: Option<String>,
    pub profile: String,
}

#[derive(Debug, Deserialize, Clone, Copy, PartialEq, Eq)]
#[serde(rename_all = "lowercase")]
pub enum Language {
    Rust,
}