Skip to content

Commit 8b3ee43

Browse files
committed
move static from once_cell to lazy_static
1 parent 2cc9ff3 commit 8b3ee43

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

stacks-signer/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ clarity = { path = "../clarity" }
2525
clap = { version = "4.1.1", features = ["derive", "env"] }
2626
hashbrown = { workspace = true }
2727
lazy_static = "1.4.0"
28-
once_cell = "1.8.0"
2928
libsigner = { path = "../libsigner" }
3029
libstackerdb = { path = "../libstackerdb" }
3130
prometheus = { version = "0.9", optional = true }

stacks-signer/src/cli.rs

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use clarity::util::hash::Sha256Sum;
2929
use clarity::util::secp256k1::MessageSignature;
3030
use clarity::vm::types::{QualifiedContractIdentifier, TupleData};
3131
use clarity::vm::Value;
32-
use once_cell::sync::Lazy;
32+
use lazy_static::lazy_static;
3333
use serde::{Deserialize, Serialize};
3434
use stacks_common::address::{
3535
b58, AddressHashMode, C32_ADDRESS_VERSION_MAINNET_MULTISIG,
@@ -48,20 +48,22 @@ const BUILD_TYPE: &'static str = "debug";
4848
#[cfg(not(debug_assertions))]
4949
const BUILD_TYPE: &'static str = "release";
5050

51-
static VERSION_STRING: Lazy<String> = Lazy::new(|| {
52-
let pkg_version = option_env!("STACKS_NODE_VERSION").unwrap_or(env!("CARGO_PKG_VERSION"));
53-
let git_branch = GIT_BRANCH.unwrap_or("");
54-
let git_commit = GIT_COMMIT.unwrap_or("");
55-
format!(
56-
"{} ({}:{}, {} build, {} [{}])",
57-
pkg_version,
58-
git_branch,
59-
git_commit,
60-
BUILD_TYPE,
61-
std::env::consts::OS,
62-
std::env::consts::ARCH
63-
)
64-
});
51+
lazy_static! {
52+
static ref VERSION_STRING: String = {
53+
let pkg_version = option_env!("STACKS_NODE_VERSION").unwrap_or(env!("CARGO_PKG_VERSION"));
54+
let git_branch = GIT_BRANCH.unwrap_or("");
55+
let git_commit = GIT_COMMIT.unwrap_or("");
56+
format!(
57+
"{} ({}:{}, {} build, {} [{}])",
58+
pkg_version,
59+
git_branch,
60+
git_commit,
61+
BUILD_TYPE,
62+
std::env::consts::OS,
63+
std::env::consts::ARCH
64+
)
65+
};
66+
}
6567

6668
#[derive(Parser, Debug)]
6769
#[command(author, version, about)]

0 commit comments

Comments
 (0)