From 5621a0ea54b2f0a69c1a6fa12184948f005574ce Mon Sep 17 00:00:00 2001 From: Jan Lukas Gernert Date: Wed, 26 Apr 2023 09:12:55 +0200 Subject: [PATCH] fmt --- article_scraper/src/full_text_parser/mod.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/article_scraper/src/full_text_parser/mod.rs b/article_scraper/src/full_text_parser/mod.rs index d9c26c4..b6679fa 100644 --- a/article_scraper/src/full_text_parser/mod.rs +++ b/article_scraper/src/full_text_parser/mod.rs @@ -381,7 +381,11 @@ impl FullTextParser { if let Some(encoding) = Self::get_encoding_from_html(&lossy_string) { log::debug!("Encoding extracted from HTML: '{}'", encoding); if let Some(decoded_html) = Self::decode_html(&bytes, encoding) { - let decoded_html = decoded_html.replacen(&format!("charset=\"{encoding}\""), "charset=\"utf-8\"", 1); + let decoded_html = decoded_html.replacen( + &format!("charset=\"{encoding}\""), + "charset=\"utf-8\"", + 1, + ); return Ok(decoded_html); } } @@ -389,7 +393,11 @@ impl FullTextParser { if let Some(encoding) = Self::get_encoding_from_http_header(&headers) { log::debug!("Encoding extracted from headers: '{}'", encoding); if let Some(decoded_html) = Self::decode_html(&bytes, encoding) { - let decoded_html = decoded_html.replacen(&format!("charset=\"{encoding}\""), "charset=\"utf-8\"", 1); + let decoded_html = decoded_html.replacen( + &format!("charset=\"{encoding}\""), + "charset=\"utf-8\"", + 1, + ); return Ok(decoded_html); } }