diff --git a/src/command/build/render.rs b/src/command/build/render.rs index 530fba1..ef0a1aa 100644 --- a/src/command/build/render.rs +++ b/src/command/build/render.rs @@ -263,9 +263,11 @@ fn build_name_contents_pairs<'a>( Ok((name, contents)) } +type ReadFileResult = std::io::Result<(PathBuf, Vec)>; + fn get_all_files>( root_dir: P, -) -> Result)>>>, walkdir::Error> { +) -> Result>, walkdir::Error> { let files = WalkDir::new(root_dir) .into_iter() .filter(|e| match e { @@ -280,7 +282,7 @@ fn get_all_files>( Ok(org_files) } -async fn read_file(path: PathBuf) -> std::io::Result<(PathBuf, Vec)> { +async fn read_file(path: PathBuf) -> ReadFileResult { let contents = tokio::fs::read(&path).await?; Ok((path, contents)) }