diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2024-08-10 19:06:46 +0200 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2024-08-10 19:06:46 +0200 |
| commit | 63cfcbe7a7745b276de58ec92e0141b958c44feb (patch) | |
| tree | 990e33a83756e27187033579ee2f85d5c79169d5 /src/app.rs | |
| parent | b747ca8af52129876b577a4f20f7105a05c6b002 (diff) | |
use unsafe blocks instead of mutexes
Diffstat (limited to 'src/app.rs')
| -rw-r--r-- | src/app.rs | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -29,7 +29,7 @@ pub struct App { impl App { pub fn new() -> Self { let sheet_id = Register::create(10, 50); - GlobalState::instance_mut() + GlobalState::get() .view .set_active_sheet(Some(sheet_id)); @@ -42,13 +42,13 @@ impl App { } pub fn run(mut self, terminal: &mut tui::Tui) -> io::Result<()> { - if let Err(e) = lua::source(&config::constants::USER_RC_PATH) { + if let Err(e) = lua::source(&config::env::USER_RC_PATH) { tui::restore()?; println!("{}", e); return Ok(()); } - while !{ GlobalState::instance().exit } { + while !{ GlobalState::get().exit } { terminal.draw(|frame| { self.render_frame(frame); @@ -84,7 +84,7 @@ impl App { } fn handle_key_event(&mut self, event: KeyEvent) { - let focus = { GlobalState::instance().active_window }; + let focus = { GlobalState::get().active_window }; let populate = GlobalKeyMap::handle(event); if populate { @@ -98,7 +98,7 @@ impl App { } fn area(&self, area: Rect) -> (Rect, Option<Rect>, Option<Rect>) { - let state = GlobalState::instance(); + let state = GlobalState::get(); let mut view = area; let mut editor = None; let mut log = None; |