manganis_cli_support/marker.rs
1/// This guard tells the marco that the application is being compiled with a CLI that supports assets
2///
3/// *If you do not hold this marker when compiling an application that uses the assets macro, the macro will display a warning about asset support*
4pub struct ManganisSupportGuard(());
5
6impl ManganisSupportGuard {
7 /// Creates a new marker
8 pub fn new() -> Self {
9 Self::default()
10 }
11}
12
13impl Default for ManganisSupportGuard {
14 fn default() -> Self {
15 std::env::set_var("MANGANIS_SUPPORT", "true");
16 Self(())
17 }
18}
19
20impl Drop for ManganisSupportGuard {
21 fn drop(&mut self) {
22 std::env::remove_var("MANGANIS_SUPPORT");
23 }
24}