summaryrefslogtreecommitdiff
path: root/src/app.rs
diff options
context:
space:
mode:
authorNathan Reiner <nathan@nathanreiner.xyz>2024-08-10 19:06:46 +0200
committerNathan Reiner <nathan@nathanreiner.xyz>2024-08-10 19:06:46 +0200
commit63cfcbe7a7745b276de58ec92e0141b958c44feb (patch)
tree990e33a83756e27187033579ee2f85d5c79169d5 /src/app.rs
parentb747ca8af52129876b577a4f20f7105a05c6b002 (diff)
use unsafe blocks instead of mutexes
Diffstat (limited to 'src/app.rs')
-rw-r--r--src/app.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/app.rs b/src/app.rs
index 87da612..3e21cf7 100644
--- a/src/app.rs
+++ b/src/app.rs
@@ -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;