Optimize various case-insensitive comparisons.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2026-02-12 09:01:46 +00:00
parent 814cbc2f37
commit 994e1d12a7
5 changed files with 9 additions and 9 deletions

View File

@@ -224,7 +224,7 @@ async fn download_html(&self, _url: &str) -> Result<UrlPreviewData> {
pub fn url_preview_allowed(&self, url: &Url) -> bool {
if ["http", "https"]
.iter()
.all(|&scheme| scheme != url.scheme().to_lowercase())
.all(|&scheme| !scheme.eq_ignore_ascii_case(url.scheme()))
{
debug!("Ignoring non-HTTP/HTTPS URL to preview: {}", url);
return false;