From 016c464f6ca8ce645316b361a14c58166b401179 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?dj8yf0=CE=BCl?= Date: Thu, 24 Oct 2024 22:20:19 +0300 Subject: [PATCH] chore: wrap some CrateMetadata code into block --- cargo-near-build/src/types/cargo/metadata.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/cargo-near-build/src/types/cargo/metadata.rs b/cargo-near-build/src/types/cargo/metadata.rs index cfec66f8..39956cf1 100644 --- a/cargo-near-build/src/types/cargo/metadata.rs +++ b/cargo-near-build/src/types/cargo/metadata.rs @@ -25,11 +25,14 @@ impl CrateMetadata { no_locked: bool, cargo_target_dir: Option<&buildtime_env::CargoTargetDir>, ) -> eyre::Result { - 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"))?;