From a6087e97e12a075dc62c15a69f5b870543de869a Mon Sep 17 00:00:00 2001 From: Charles Hall Date: Thu, 6 Jun 2024 21:51:54 -0700 Subject: [PATCH] remove config deprecation functionality This is a hard fork, we don't need to inherit this cruft. Really, I should've noticed and removed this closer to the beginning of our history. --- src/config.rs | 32 +------------------------------- src/main.rs | 2 -- 2 files changed, 1 insertion(+), 33 deletions(-) diff --git a/src/config.rs b/src/config.rs index 8c63251d..3b1f0397 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,13 +1,11 @@ use std::{ - collections::BTreeMap, fmt, fmt::Write, net::{IpAddr, Ipv4Addr}, }; use ruma::{OwnedServerName, RoomVersionId}; -use serde::{de::IgnoredAny, Deserialize}; -use tracing::warn; +use serde::Deserialize; mod proxy; @@ -82,11 +80,6 @@ pub(crate) struct Config { pub(crate) turn_ttl: u64, pub(crate) emergency_password: Option, - - #[serde(flatten)] - // This has special meaning to `serde` - #[allow(clippy::zero_sized_map_values)] - pub(crate) catchall: BTreeMap, } #[derive(Debug, Deserialize)] @@ -95,29 +88,6 @@ pub(crate) struct TlsConfig { pub(crate) key: String, } -const DEPRECATED_KEYS: &[&str] = &["cache_capacity"]; - -impl Config { - pub(crate) fn warn_deprecated(&self) { - let mut was_deprecated = false; - for key in self - .catchall - .keys() - .filter(|key| DEPRECATED_KEYS.iter().any(|s| s == key)) - { - warn!("Config parameter {} is deprecated", key); - was_deprecated = true; - } - - if was_deprecated { - warn!( - "Read grapevine documentation and check your configuration if \ - any new configuration parameters should be adjusted" - ); - } - } -} - impl fmt::Display for Config { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { // Prepare a list of config values to show diff --git a/src/main.rs b/src/main.rs index 4a661b7c..bc877d6d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -115,8 +115,6 @@ async fn try_main() -> Result<(), error::Main> { let config = raw_config.extract::()?; - config.warn_deprecated(); - let _guard = observability::init(&config); // This is needed for opening lots of file descriptors, which tends to