use serde_yaml;
use thiserror::Error as E;

/// A specialized [`Result`] type for markdown operations.
///
/// [`Result`]: https://doc.rust-lang.org/std/result/enum.Result.html
pub type Result<T> = std::result::Result<T, Error>;

/// An enum contains all errors that might occur.
#[derive(Debug, E)]
pub enum Error {
    /// Error when parsing the frontmatter YAML.
    #[error("(de)serializing error: {0}")]
    FrontMatterError(#[from] serde_yaml::Error),
}
