diff options
Diffstat (limited to 'icons/src/lib.rs')
-rw-r--r-- | icons/src/lib.rs | 47 |
1 files changed, 2 insertions, 45 deletions
diff --git a/icons/src/lib.rs b/icons/src/lib.rs index e9ef054..ae8d747 100644 --- a/icons/src/lib.rs +++ b/icons/src/lib.rs @@ -3,50 +3,7 @@ pub struct Icon { pub content: &'static str, } -macro_rules! icons_consts { - ($i:ident => $p:expr) => { - pub const $i: Icon = Icon { - path: $p, - content: include_str!(concat!("../res/", $p)), - }; - }; - ($i1:ident => $p1:expr, $($i2:ident => $p2:expr),+) => { - icons_consts! { $i1 => $p1 } - icons_consts! { $($i2 => $p2),+ } - } +mod icons { + include!(concat!(env!("OUT_DIR"), "/icons.rs")); } - -macro_rules! icons_map { - ($($i:ident => $p:expr),+) => { - pub const ICONS_MAP: phf::Map<&'static str, &'static Icon> = phf::phf_map! { - $($p => &icons::$i),+ - }; - } -} - -macro_rules! icons { - ($($i:ident => $p:expr),+) => { - pub mod icons { - use super::Icon; - - icons_consts! { - $($i => $p),+ - } - } - - icons_map! { - $($i => $p),+ - } - } -} - -icons! { - LOGOUT => "logout.svg", - NOTIFICATIONS => "notifications.svg", - NOTIFICATIONS_SOME => "notifications-some.svg", - PERSON => "person.svg", - UPVOTE => "upvote.svg", - UPVOTED => "upvoted.svg" -} - pub use icons::*; |