Skip to content

Commit

Permalink
fix: Use SCREAMING_SNAKE_CASE for static variable authors
Browse files Browse the repository at this point in the history
  • Loading branch information
amaanq committed Mar 6, 2024
1 parent 690f555 commit 2aea950
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions clap_builder/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}};
() => {
Expand Down

0 comments on commit 2aea950

Please sign in to comment.