aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Grois <andi@grois.info>2021-11-30 09:17:38 +0100
committerAndreas Grois <andi@grois.info>2021-11-30 09:17:38 +0100
commit3f362de1ab94b994ef4ccdc403cab4cb8d0d1bcb (patch)
tree2fcb2238d79bb5c9bfaaaa2801b478735581f222
parentc0a2f3103a9168f1fc48d36ac975081e531a7899 (diff)
Move global allocator selection to swaystatus-plugin.
This way plugins needn't set it manually.
-rw-r--r--swaystatus-plugin/src/lib.rs3
-rw-r--r--swaystatus/src/main.rs3
2 files changed, 3 insertions, 3 deletions
diff --git a/swaystatus-plugin/src/lib.rs b/swaystatus-plugin/src/lib.rs
index e54e057..95ecdf2 100644
--- a/swaystatus-plugin/src/lib.rs
+++ b/swaystatus-plugin/src/lib.rs
@@ -48,6 +48,9 @@ pub static RUSTC_VERSION : &str = env!("RUSTC_VERSION");
#[doc(hidden)]
pub static MODULE_VERSION : &str = env!("CARGO_PKG_VERSION");
+#[global_allocator]
+static GLOBAL : std::alloc::System = std::alloc::System;
+
/// Declares a public export C function that creates your plugin's main object.
/// parameters are: The plugin's concrete type, and the constructor function for it.
/// This is blatantly stolen from
diff --git a/swaystatus/src/main.rs b/swaystatus/src/main.rs
index f476131..8d487fc 100644
--- a/swaystatus/src/main.rs
+++ b/swaystatus/src/main.rs
@@ -14,9 +14,6 @@ use commandline::CommandlineAction;
#[cfg(test)]
pub mod test_plugin;
-#[global_allocator]
-static GLOBAL : std::alloc::System = std::alloc::System;
-
fn main() {
let text_domain = match dirs::data_dir() {
Some (p) => TextDomain::new("swaystatus").prepend("target").push(p),