Skip to content

Commit

Permalink
Fix: unwraps while ignoring log lines (DioxusLabs#3370)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkelleyrtp authored Dec 17, 2024
1 parent 86082ce commit eb76d48
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 96 deletions.
90 changes: 2 additions & 88 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ trybuild = "1.0"
dirs = "5.0.1"
cargo-config2 = "0.1.26"
criterion = { version = "0.5" }
walrus = "0.23.2"
cargo_metadata = "0.18.1"
parking_lot = "0.12.1"
tracing-wasm = "0.2.1"
Expand Down
1 change: 0 additions & 1 deletion packages/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ syn = { workspace = true, features = ["full", "extra-traits", "visit", "visit-mu

headers = "0.4.0"
walkdir = "2"
walrus = { workspace = true, features = ["parallel"] }

# tools download
dirs = { workspace = true }
Expand Down
2 changes: 2 additions & 0 deletions packages/cli/src/build/bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions packages/cli/src/build/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/cli/bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit eb76d48

Please sign in to comment.