#![cfg_attr(nightly, feature(int_error_matching))] #![allow(dead_code)] #[cfg(feature="splash")] mod splash; mod arg; mod error; pub use error::{ErrorExt as _, ResultExt as _}; mod stage; mod leanify; mod process; mod work; async fn work() -> Result<(), Box> { let args = arg::parse_args().with_prefix("failed to parse args")?; let leanify = leanify::find_binary().with_prefix("Couldn't find leanify binary")?; Ok(()) } #[tokio::main] async fn main() { prettify_expect(work().await.map_err(|e| e.to_string()), "exited with error"); } #[inline] fn prettify_expect(res: Result, msg: S) -> T where S: AsRef, E: std::fmt::Display { match res { Ok(v) => v, Err(e) => { eprintln!("\n{}: {}", msg.as_ref(), e); std::process::exit(1) }, } }