From bff1ca89c8a99081b37da0807cb99fc63797fbf6 Mon Sep 17 00:00:00 2001 From: Bugen Zhao Date: Tue, 6 Aug 2024 15:33:43 +0800 Subject: [PATCH] leave it blank in docs Signed-off-by: Bugen Zhao --- src/common/src/config.rs | 9 ++++++--- src/license/src/key.rs | 5 +++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/common/src/config.rs b/src/common/src/config.rs index d4b9501d6e0d..083a8b77b4f3 100644 --- a/src/common/src/config.rs +++ b/src/common/src/config.rs @@ -2379,12 +2379,15 @@ pub struct CompactionConfig { #[cfg(test)] mod tests { + use risingwave_license::LicenseKey; + use super::*; fn default_config_for_docs() -> RwConfig { - // Although we have `license_key` default to a test-only value in the code, - // it gets redacted during serialization, so we don't need to do anything special here. - RwConfig::default() + let mut config = RwConfig::default(); + // Set `license_key` to empty in the docs to avoid any confusion. + config.system.license_key = Some(LicenseKey::empty()); + config } /// This test ensures that `config/example.toml` is up-to-date with the default values specified diff --git a/src/license/src/key.rs b/src/license/src/key.rs index 01d8ac313f79..65e726c6e838 100644 --- a/src/license/src/key.rs +++ b/src/license/src/key.rs @@ -120,6 +120,11 @@ impl<'a> From> for LicenseKey { } impl LicenseKey { + /// Create an empty license key, which means no license key is set. + pub fn empty() -> Self { + Self(String::new()) + } + /// Convert to a reference. pub fn as_ref(&self) -> LicenseKeyRef<'_> { LicenseKey(self.0.as_ref())