Skip to content

Commit

Permalink
Auto rebuild workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
cyqsimon committed Feb 12, 2023
1 parent fa687c8 commit 4cf6b8e
Showing 1 changed file with 6 additions and 0 deletions.
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

0 comments on commit 4cf6b8e

Please sign in to comment.