Fix: unwraps while ignoring log lines (#3370)

This commit is contained in:
Jonathan Kelley authored and GitHub committed 2024-12-16 17:13:52 -08:00
1 parent 86082cec5c
commit eb76d48eae
6 files changed
+9 -96

No files matched your search

+2
View File
@@ -414,6 +414,8 @@ impl AppBundle {
Ok(())
})
}
tracing::debug!("Removing old assets");
remove_old_assets(&asset_dir, &bundled_output_paths).await?;
// todo(jon): we also want to eventually include options for each asset's optimization and compression, which we currently aren't
+3 -4
View File
@@ -174,10 +174,9 @@ impl BuildRequest {
else => break,
};
let message = Message::parse_stream(std::io::Cursor::new(line))
.next()
.unwrap()
.unwrap();
let Some(Ok(message)) = Message::parse_stream(std::io::Cursor::new(line)).next() else {
continue;
};
match message {
Message::BuildScriptExecuted(_) => units_compiled += 1,
+2 -2
View File
@@ -77,7 +77,7 @@ impl Bundle {
for bundle in bundles {
for src in bundle.bundle_paths {
let src = if let Some(outdir) = &self.outdir {
let dest = outdir.join(src.file_name().unwrap());
let dest = outdir.join(src.file_name().expect("Filename to exist"));
crate::fastfs::copy_asset(&src, &dest)?;
dest
} else {
@@ -177,7 +177,7 @@ impl Bundle {
for entry in std::fs::read_dir(bundle.build.asset_dir())?.flatten() {
let old = entry.path().canonicalize()?;
let new = PathBuf::from("assets").join(old.file_name().unwrap());
let new = PathBuf::from("assets").join(old.file_name().expect("Filename to exist"));
tracing::debug!("Bundled asset: {old:?} -> {new:?}");
bundle_settings