From a6d27d19656b7a835a6c51ff4400aa93fbb876f5 Mon Sep 17 00:00:00 2001 From: monosans Date: Wed, 24 Dec 2025 13:56:35 +0300 Subject: [PATCH] fix: optimize empty string handling --- src/raw_config.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/raw_config.rs b/src/raw_config.rs index ffe4bf3..2dcff19 100644 --- a/src/raw_config.rs +++ b/src/raw_config.rs @@ -38,7 +38,7 @@ where Ok(Some(u)) } else { let type_label = match allowed_schemes { - [] => "".into(), + [] => compact_str::CompactString::const_new(""), [single] => compact_str::format_compact!("'{single}'"), [rest @ .., last] => { let mut t = compact_str::CompactString::const_new(""); @@ -187,7 +187,10 @@ impl<'de> serde::Deserialize<'de> for OutputConfig { const CONFIG_ENV: &str = "PROXY_SCRAPER_CHECKER_CONFIG"; pub fn get_config_path() -> compact_str::CompactString { - env::var(CONFIG_ENV).map_or_else(move |_| "config.toml".into(), Into::into) + env::var(CONFIG_ENV).map_or_else( + move |_| compact_str::CompactString::const_new("config.toml"), + Into::into, + ) } pub async fn read_config(path: &Path) -> crate::Result {