move function

This commit is contained in:
Felix Ableitner 2021-07-22 23:02:36 +02:00
parent 22ce499096
commit ea5891857b
2 changed files with 7 additions and 7 deletions

View file

@ -132,6 +132,12 @@ impl Settings {
Ok(Self::read_config_file()?)
}
pub(crate) fn actor_name_max_length(&self) -> usize {
self
.actor_name_max_length
.unwrap_or_else(|| Settings::default().actor_name_max_length.unwrap())
}
pub fn database(&self) -> DatabaseConfig {
self.database.to_owned().unwrap_or_default()
}

View file

@ -21,13 +21,7 @@ pub struct Settings {
pub(crate) actor_name_max_length: Option<usize>,
}
impl Settings {
pub(crate) fn actor_name_max_length(&self) -> usize {
self
.actor_name_max_length
.unwrap_or_else(|| Settings::default().actor_name_max_length.unwrap())
}
}
impl Settings {}
#[derive(Debug, Deserialize, Clone)]
pub struct CaptchaConfig {