about summary refs log tree commit diff
path: root/src/messages.rs
diff options
context:
space:
mode:
authorGriffin Smith <root@gws.fyi>2019-07-14T16·12-0400
committerGriffin Smith <root@gws.fyi>2019-07-14T16·12-0400
commit67d18b486c6376c7637b3494722ddf1eb525288c (patch)
treea2c7c415e685a00ca005df9ff643c162f772d9a6 /src/messages.rs
parent405dbffe376b05af31dc57f027658c70b4fb9634 (diff)
Factor out static_cfg from static init of messages
Factor out a macro for static references to data parsed from config
files at compile-time.
Diffstat (limited to 'src/messages.rs')
-rw-r--r--src/messages.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/messages.rs b/src/messages.rs
index 03a96b4a0a64..948787f1393b 100644
--- a/src/messages.rs
+++ b/src/messages.rs
@@ -165,11 +165,8 @@ choice = ["Say this", "Or this"]
     }
 }
 
-static MESSAGES_RAW: &'static str = include_str!("messages.toml");
-
-lazy_static! {
-    static ref MESSAGES: NestedMap<'static> =
-        toml::from_str(MESSAGES_RAW).unwrap();
+static_cfg! {
+    static ref MESSAGES: NestedMap<'static> = toml_file("messages.toml");
 }
 
 /// Look up a game message based on the given (dot-separated) name, with the