Fix failing checks

This commit is contained in:
Butter Cat 2024-03-30 18:53:46 -04:00
parent 4e2648280d
commit 4f0b29f930
No known key found for this signature in database
GPG Key ID: FF37BE4FDDB74419

View File

@ -894,14 +894,14 @@ pub fn rewrite_urls(input_text: &str) -> String {
// Rewrite external media previews to Redlib // Rewrite external media previews to Redlib
if REDDIT_PREVIEW_REGEX.is_match(&text1) { if REDDIT_PREVIEW_REGEX.is_match(&text1) {
loop { loop {
if REDDIT_PREVIEW_REGEX.find(&text1) == None { if REDDIT_PREVIEW_REGEX.find(&text1).is_none() {
return text1; return text1;
} else { } else {
text1 = REDDIT_PREVIEW_REGEX text1 = REDDIT_PREVIEW_REGEX
.replace(&text1, format_url(REDDIT_PREVIEW_REGEX.find(&text1).map(|x| x.as_str()).unwrap_or_default())) .replace(&text1, format_url(REDDIT_PREVIEW_REGEX.find(&text1).map(|x| x.as_str()).unwrap_or_default()))
.to_string() .to_string()
} }
}; }
} else { } else {
text1 text1
} }