mirror of
https://github.com/clap-rs/clap
synced 2024-12-14 06:42:33 +00:00
Merge pull request #5386 from amaanq/static-var-name
fix: use SCREAMING_SNAKE_CASE for static variable `authors`
This commit is contained in:
commit
3ba429752f
1 changed files with 4 additions and 4 deletions
|
@ -42,14 +42,14 @@ macro_rules! crate_version {
|
|||
#[macro_export]
|
||||
macro_rules! crate_authors {
|
||||
($sep:expr) => {{
|
||||
static authors: &str = env!("CARGO_PKG_AUTHORS");
|
||||
if authors.contains(':') {
|
||||
static AUTHORS: &str = env!("CARGO_PKG_AUTHORS");
|
||||
if AUTHORS.contains(':') {
|
||||
static CACHED: std::sync::OnceLock<String> = std::sync::OnceLock::new();
|
||||
let s = CACHED.get_or_init(|| authors.replace(':', $sep));
|
||||
let s = CACHED.get_or_init(|| AUTHORS.replace(':', $sep));
|
||||
let s: &'static str = &*s;
|
||||
s
|
||||
} else {
|
||||
authors
|
||||
AUTHORS
|
||||
}
|
||||
}};
|
||||
() => {
|
||||
|
|
Loading…
Reference in a new issue