From 5873fab6f48ba5e3ce10abdd446aa972efbd108d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kaya=20G=C3=B6kalp?= Date: Wed, 11 Dec 2024 22:34:22 -0800 Subject: [PATCH] Update forc-plugins/forc-node/src/chain_config.rs Co-authored-by: Joshua Batty --- forc-plugins/forc-node/src/chain_config.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/forc-plugins/forc-node/src/chain_config.rs b/forc-plugins/forc-node/src/chain_config.rs index 82232f6bcb8..f2f84d48f84 100644 --- a/forc-plugins/forc-node/src/chain_config.rs +++ b/forc-plugins/forc-node/src/chain_config.rs @@ -34,13 +34,12 @@ impl Display for ChainConfig { } impl From for PathBuf { fn from(value: ChainConfig) -> Self { - let user_forc_dir = user_forc_directory().join(CONFIG_FOLDER); - - match value { - ChainConfig::Local => user_forc_dir.join(LOCAL_CONFIG_FOLDER_NAME), - ChainConfig::Testnet => user_forc_dir.join(TESTNET_CONFIG_FOLDER_NAME), - ChainConfig::Ignition => user_forc_dir.join(IGNITION_CONFIG_FOLDER_NAME), - } + let folder_name = match value { + ChainConfig::Local => LOCAL_CONFIG_FOLDER_NAME, + ChainConfig::Testnet => TESTNET_CONFIG_FOLDER_NAME, + ChainConfig::Ignition => IGNITION_CONFIG_FOLDER_NAME, + }; + user_forc_directory().join(CONFIG_FOLDER).join(folder_name) } }