mirror of
https://github.com/chatmail/core.git
synced 2026-05-07 08:56:30 +03:00
refactor: Make Context::config_exists() crate-public
This commit is contained in:
@@ -438,8 +438,11 @@ impl Config {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Context {
|
impl Context {
|
||||||
/// Returns true if configuration value is set for the given key.
|
/// Returns true if configuration value is set in the db for the given key.
|
||||||
pub async fn config_exists(&self, key: Config) -> Result<bool> {
|
///
|
||||||
|
/// 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())
|
Ok(self.sql.get_raw_config(key.as_ref()).await?.is_some())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user