From 5b2bc3cc6a672ce091fc888a426ff68cedd9d1a8 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Wed, 13 Mar 2019 08:00:53 -0700 Subject: [PATCH] remove some dead code --- src/guiloop/mod.rs | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/src/guiloop/mod.rs b/src/guiloop/mod.rs index b80dfd6ad..807c4cef2 100644 --- a/src/guiloop/mod.rs +++ b/src/guiloop/mod.rs @@ -27,10 +27,6 @@ impl Default for GuiSelection { } } -thread_local! { - static GUI_SYSTEM: RefCell>> = RefCell::new(None); -} - impl GuiSelection { pub fn try_new(self, mux: &Rc) -> Result, Error> { let system = match self { @@ -40,28 +36,9 @@ impl GuiSelection { #[cfg(not(all(unix, not(target_os = "macos"))))] GuiSelection::X11 => bail!("X11 not compiled in"), }; - - if let Ok(sys) = &system { - GUI_SYSTEM.with(|g| { - *g.borrow_mut() = Some(Rc::clone(&sys)); - }); - } - system } - /// Returns a reference to the gui system. - /// Will return None if not called on the gui thread. - pub fn get() -> Option> { - let mut res = None; - GUI_SYSTEM.with(|g| { - if let Some(sys) = &*g.borrow() { - res = Some(Rc::clone(sys)); - } - }); - res - } - // TODO: find or build a proc macro for this pub fn variants() -> Vec<&'static str> { vec!["Glutin", "X11"]