#[macro_export]
#[cfg(debug_assertions)]
macro_rules! static_resources_initialize {
( $resources:expr, $($name:expr, $path:expr), * $(,)* ) => {
use std::fs;
$(
$resources.register_resource_file($name, $path).unwrap();
)*
};
}
#[macro_export]
#[cfg(not(debug_assertions))]
macro_rules! static_resources_initialize {
( $resources:expr, $($name:expr, $path:expr), * $(,)* ) => {
use std::fs;
$(
$resources.register_resource_static($name, concat!(env!("CARGO_MANIFEST_DIR"), "/", $path), include_bytes!(concat!(env!("CARGO_MANIFEST_DIR"), "/", $path)));
)*
};
}
#[macro_export]
macro_rules! static_response {
($name:expr) => {{
use rocket_include_static_resources::StaticResponse;
StaticResponse::build($name)
}};
}