remove some dead code
This commit is contained in:
1 parent
e923473b5c
commit
5b2bc3cc6a
1 file changed
-23
@@ -27,10 +27,6 @@ impl Default for GuiSelection {
|
||||
}
|
||||
}
|
||||
|
||||
thread_local! {
|
||||
static GUI_SYSTEM: RefCell<Option<Rc<GuiSystem>>> = RefCell::new(None);
|
||||
}
|
||||
|
||||
impl GuiSelection {
|
||||
pub fn try_new(self, mux: &Rc<Mux>) -> Result<Rc<GuiSystem>, 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<Rc<GuiSystem>> {
|
||||
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"]
|
||||
|
||||
Reference in new issue
Block a user