1mod app;
2mod style;
3
4use nio::RuntimeContext;
5
6use crate::app::App;
7use std::io::Result;
8
9
10
11#[allow(warnings)]
12pub fn launch() {
13 let last_worker = RuntimeContext::current().metrics().num_workers() - 1;
14 nio::spawn_pinned_at(last_worker.try_into().unwrap(), launch_init);
15}
16
17async fn launch_init() {
18 if let Err(err) = init().await {
19 eprintln!("{err:#?}");
20 }
21}
22
23pub async fn init() -> Result<()> {
24 let terminal = ratatui::init();
25 let result = App::new().run(terminal).await;
26 ratatui::restore();
27 result
28}