From be125ee7df307123bac77ba26b2df6234aa2d71b Mon Sep 17 00:00:00 2001 From: Vlad Frolov Date: Sat, 6 Jul 2024 00:43:10 +0200 Subject: [PATCH] minor refactoring --- src/js_command_match/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/js_command_match/mod.rs b/src/js_command_match/mod.rs index 7fba5c3bf..3d3ab7317 100644 --- a/src/js_command_match/mod.rs +++ b/src/js_command_match/mod.rs @@ -33,7 +33,8 @@ pub enum JsCmd { impl JsCmd { pub fn rust_command_generation(&self) -> Result<(Vec, String), String> { let network = std::env::var("NEAR_NETWORK") - .unwrap_or_else(|_| std::env::var("NEAR_ENV").unwrap_or_else(|_| "testnet".to_owned())); + .or_else(|_| std::env::var("NEAR_ENV")) + .unwrap_or_else(|_| "testnet".to_owned()); let message = "The command you tried to run is deprecated in the new NEAR CLI, but we tried our best to match the old command with the new syntax, try it instead:".to_string(); let validator_extension_message = "The command you tried to run has been moved into its own CLI extension called near-validator.\nPlease, follow the installation instructions here: https://github.com/near-cli-rs/near-validator-cli-rs/blob/master/README.md".to_string();