Commit
Message
Changed Files (2)
-
modified CHANGELOG.md
diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b4e4e7..8241e6d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,10 @@ - Split builder running & output rendering into own modules - *(templates,cli)* Extract <header> into base.html; dump-theme only writes enabled formats + +### ⚡ Performance + +- Don't read artifacts 2 times (1 to generate hash, the other to copy to final resting place ## [0.7.1] - 2026-06-16 ### 🚀 Features -
modified src/site.rs
diff --git a/src/site.rs b/src/site.rs index 9ccfafe..f449509 100644 --- a/src/site.rs +++ b/src/site.rs @@ -185,19 +185,14 @@ pub async fn build_site(config: AbbayeConfig) -> Result<()> { .await .into_diagnostic()?; - for artifact in &dist_artifacts { - tokio::fs::copy(&artifact.path, dist_dir.join(&artifact.name)) - .await - .into_diagnostic()?; - } - - // Compute size + SHA-256 for each copied dist artifact. + // Copy dist artifacts and compute size + SHA-256 in a single pass. let mut dist_file_infos: Vec<DistFileInfo> = Vec::new(); for artifact in &dist_artifacts { - let dest = dist_dir.join(&artifact.name); - let bytes = tokio::fs::read(&dest).await.into_diagnostic()?; + let bytes = tokio::fs::read(&artifact.path).await.into_diagnostic()?; let size_bytes = bytes.len() as u64; let sha256 = hex_sha256(&bytes); + let dest = dist_dir.join(&artifact.name); + tokio::fs::write(&dest, &bytes).await.into_diagnostic()?; dist_file_infos.push(DistFileInfo { name: artifact.name.clone(), size_bytes,