Fix clippy issues.
All checks were successful
rust-test Build rust-test has succeeded
rust-clippy Build rust-clippy has succeeded
build-natter Build build-natter has succeeded
format Build format has succeeded

This commit is contained in:
Tom Alexander
2023-12-23 06:38:23 -05:00
parent 818fca87f2
commit 397d4ea0bc
20 changed files with 42 additions and 73 deletions

View File

@@ -62,7 +62,7 @@ async fn get_post_directories(config: &Config) -> Result<Vec<PathBuf>, CustomErr
async fn load_blog_posts(config: &Config) -> Result<Vec<BlogPost>, CustomError> {
let root_directory = config.get_root_directory().to_owned();
let post_directories = get_post_directories(&config).await?;
let post_directories = get_post_directories(config).await?;
let load_jobs = post_directories
.into_iter()
.map(|path| tokio::spawn(BlogPost::load_blog_post(root_directory.clone(), path)));

View File

@@ -13,7 +13,7 @@ pub(crate) async fn init_natter_folder(args: InitArgs) -> Result<(), CustomError
let mut existing_entries = tokio::fs::read_dir(&args.path).await?;
let first_entry = existing_entries.next_entry().await?;
if let Some(_) = first_entry {
if first_entry.is_some() {
return Err("The directory is not empty. Aborting.".into());
}