Skip to content

Commit

Permalink
leave it blank in docs
Browse files Browse the repository at this point in the history
Signed-off-by: Bugen Zhao <[email protected]>
  • Loading branch information
BugenZhao committed Aug 6, 2024
1 parent 0d8e2e3 commit bff1ca8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/common/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions src/license/src/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ impl<'a> From<LicenseKeyRef<'a>> 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())
Expand Down

0 comments on commit bff1ca8

Please sign in to comment.