aboutsummaryrefslogtreecommitdiffstats
path: root/src/tui.rs
blob: 296f1bf7d6fba46d131996fed274827357836072 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use snafu::ResultExt as _;

#[derive(Debug, snafu::Snafu)]
pub enum Error {
    #[snafu(display("error from state: {}", source))]
    State { source: crate::state::Error },
}

pub fn tui() {
    let state = crate::state::State::new().context(State);
    match state {
        Ok(state) => tokio::run(state),
        Err(e) => eprintln!("failed to create state: {}", e),
    }
}