refactor: Make Context::config_exists() crate-public

This commit is contained in:
iequidoo
2024-09-09 21:38:05 -03:00
committed by iequidoo
parent ff6488371c
commit 52dcc7e350

View File

@@ -438,8 +438,11 @@ impl Config {
}
impl Context {
/// Returns true if configuration value is set for the given key.
pub async fn config_exists(&self, key: Config) -> Result<bool> {
/// Returns true if configuration value is set in the db for the given key.
///
/// NB: Don't use this to check if the key is configured because this doesn't look into
/// environment. The proper use of this function is e.g. checking a key before setting it.
pub(crate) async fn config_exists(&self, key: Config) -> Result<bool> {
Ok(self.sql.get_raw_config(key.as_ref()).await?.is_some())
}