From 52dcc7e3507331c22c425e5ecb7bf1f6f8840520 Mon Sep 17 00:00:00 2001 From: iequidoo Date: Mon, 9 Sep 2024 21:38:05 -0300 Subject: [PATCH] refactor: Make Context::config_exists() crate-public --- src/config.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/config.rs b/src/config.rs index 0f680d229..408ea8eb2 100644 --- a/src/config.rs +++ b/src/config.rs @@ -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 { + /// 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 { Ok(self.sql.get_raw_config(key.as_ref()).await?.is_some()) }