Skip to content

Commit

Permalink
chore: wrap some CrateMetadata code into block
Browse files Browse the repository at this point in the history
  • Loading branch information
dj8yf0μl committed Oct 24, 2024
1 parent 46cdd06 commit 016c464
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions cargo-near-build/src/types/cargo/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,14 @@ impl CrateMetadata {
no_locked: bool,
cargo_target_dir: Option<&buildtime_env::CargoTargetDir>,
) -> eyre::Result<Self> {
let (mut metadata, root_package) =
get_cargo_metadata(&manifest_path, no_locked, cargo_target_dir)?;

metadata.target_directory = crate::fs::force_canonicalize_dir(&metadata.target_directory)?;
metadata.workspace_root = metadata.workspace_root.canonicalize_utf8()?;
let (metadata, root_package) = {
let (mut metadata, root_package) =
get_cargo_metadata(&manifest_path, no_locked, cargo_target_dir)?;
metadata.target_directory =
crate::fs::force_canonicalize_dir(&metadata.target_directory)?;
metadata.workspace_root = metadata.workspace_root.canonicalize_utf8()?;
(metadata, root_package)
};

let mut target_directory =
crate::fs::force_canonicalize_dir(&metadata.target_directory.join("near"))?;
Expand Down

0 comments on commit 016c464

Please sign in to comment.