Skip to content

Commit

Permalink
fmt again
Browse files Browse the repository at this point in the history
  • Loading branch information
dsmith3197 committed Sep 20, 2023
1 parent 698f525 commit 790a97a
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@ pub use source_sender::SourceSender;
pub use vector_common::{shutdown, Error, Result};
pub use vector_core::{event, metrics, schema, tcp, tls};

static APP_NAME_SLUG: std::sync::OnceLock<String> = std::sync::OnceLock::new();

/// Flag denoting whether or not enterprise features are enabled.
#[cfg(feature = "enterprise")]
pub static ENTERPRISE_ENABLED: std::sync::OnceLock<bool> = std::sync::OnceLock::new();

static APP_NAME_SLUG: std::sync::OnceLock<String> = std::sync::OnceLock::new();

/// The name used to identify this Vector application.
///
/// This can be set at compile-time through the VECTOR_APP_NAME env variable.
Expand All @@ -138,10 +138,7 @@ pub fn get_app_name() -> &'static str {
#[cfg(not(feature = "enterprise"))]
let app_name = "Vector";
#[cfg(feature = "enterprise")]
let app_name = if *ENTERPRISE_ENABLED
.get()
.unwrap_or(&false)
{
let app_name = if *ENTERPRISE_ENABLED.get().unwrap_or(&false) {
"Vector Enterprise"
} else {
"Vector"
Expand All @@ -154,7 +151,9 @@ pub fn get_app_name() -> &'static str {
///
/// Defaults to "vector".
pub fn get_slugified_app_name() -> String {
APP_NAME_SLUG.get_or_init(|| get_app_name().to_lowercase().replace(' ', "-")).clone()
APP_NAME_SLUG
.get_or_init(|| get_app_name().to_lowercase().replace(' ', "-"))
.clone()
}

/// The current version of Vector in simplified format.
Expand Down

0 comments on commit 790a97a

Please sign in to comment.