Switch to using CustomError because a boxed StdError is not Send.

This commit is contained in:
Tom Alexander
2023-10-22 13:44:03 -04:00
parent d8fc49797e
commit 2f0f3ab346
8 changed files with 95 additions and 61 deletions

View File

@@ -6,12 +6,14 @@ use self::cli::parameters::Cli;
use self::cli::parameters::Commands;
use self::command::build::build_site;
use self::command::init::init_writer_folder;
use self::error::CustomError;
mod blog_post;
mod cli;
mod command;
mod config;
mod error;
fn main() -> Result<ExitCode, Box<dyn std::error::Error>> {
fn main() -> Result<ExitCode, CustomError> {
let rt = tokio::runtime::Runtime::new()?;
rt.block_on(async {
let main_body_result = main_body().await;
@@ -19,7 +21,7 @@ fn main() -> Result<ExitCode, Box<dyn std::error::Error>> {
})
}
async fn main_body() -> Result<ExitCode, Box<dyn std::error::Error>> {
async fn main_body() -> Result<ExitCode, CustomError> {
let args = Cli::parse();
match args.command {
Commands::Init(args) => {