wasm-css 0.2.0

Ergonomic WASM CSS Framework
Documentation
// Authors: Robert Lopez

/// Represents any `Error` as a human readable error String
///
/// The only way Errors can occur in this crate are not having access to the:
/// Head, Crypto, Window, or Document objects.
#[derive(Debug)]
pub struct WasmCssError(pub String);

impl std::fmt::Display for WasmCssError {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        writeln!(f, "WasmCssError: {}", self.0)
    }
}

impl std::error::Error for WasmCssError {}

macro_rules! format_error {
    ($fmt:expr $(, $arg:expr)*) => {
        $crate::error::WasmCssError(format!($fmt $(, $arg)*))
    };
}

pub(crate) use format_error;