Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto rebuild workaround #13

Merged
merged 1 commit into from
Feb 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,19 @@ pub use lazy_static::lazy_static;
macro_rules! flate {
($(#[$meta:meta])*
$(pub $(($($vis:tt)+))?)? static $name:ident: [u8] from $path:literal) => {
// HACK: workaround to make cargo auto rebuild on modification of source file
const _: &'static [u8] = include_bytes!(concat!(env!("CARGO_MANIFEST_DIR"), "/", $path));

$crate::lazy_static! {
$(#[$meta])*
$(pub $(($($vis)+))?)? static ref $name: ::std::vec::Vec<u8> = $crate::decode($crate::codegen::deflate_file!($path));
}
};
($(#[$meta:meta])*
$(pub $(($($vis:tt)+))?)? static $name:ident: str from $path:literal) => {
// HACK: workaround to make cargo auto rebuild on modification of source file
const _: &'static str = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/", $path));

$crate::lazy_static! {
$(#[$meta])*
$(pub $(($($vis)+))?)? static ref $name: ::std::string::String = $crate::decode_string($crate::codegen::deflate_utf8_file!($path));
Expand Down