1pub mod app;
2pub use app::*;
3
4mod reader;
5pub use reader::Reader;
6
7mod editor;
8pub use editor::Editor;
9
10pub trait ForceUnwrap<T: std::fmt::Debug> {
11 fn force_unwrap(self) -> T;
12}
13
14impl<T: std::fmt::Debug> ForceUnwrap<T> for Option<T> {
15 fn force_unwrap(self) -> T {
16 match self {
17 Some(t) => t,
18 None => {
19 println!("Unexpected found none value at {:?}", self);
20 std::process::exit(0);
21 }
22 }
23 }
24}
25
26impl<T: std::fmt::Debug, E: std::fmt::Debug> ForceUnwrap<T> for Result<T, E> {
27 fn force_unwrap(self) -> T {
28 match self {
29 Ok(t) => t,
30 Err(e) => {
31 println!("Unexpected found error at {:?}", e);
32 std::process::exit(0);
33 }
34 }
35 }
36}