JHHM

lol-cal

terminal lolesports schedule viewer
git clone https://jhhm.no/repos/lol-cal.git

lol-cal/src/main.rs

get raw file: main.rs

1use crate::app::App;
2use tracing::*;
3
4pub mod app;
5pub mod config;
6pub mod event;
7pub mod logging;
8pub mod net;
9pub mod resources;
10pub mod widgets;
11
12#[tokio::main]
13async fn main() -> color_eyre::Result<()> {
14    tui_main().await
15}
16
17async fn tui_main() -> color_eyre::Result<()> {
18    color_eyre::install()?;
19    crate::logging::init()?;
20    let mut app = App::new()?;
21    app.init();
22
23    info!("{:?}", app.config);
24
25    let mut terminal = ratatui::init();
26    terminal.clear()?; // needed for first clear in tty
27    let result = app.run(terminal).await;
28    ratatui::restore();
29    result
30}