From f7fa69692108cb6fd7a7a5d3a0f0a7ecf4ba4aa3 Mon Sep 17 00:00:00 2001 From: Jan Lukas Gernert Date: Sun, 19 Mar 2023 23:37:42 +0100 Subject: [PATCH] fmt & clippy --- src/constants.rs | 4 ++-- src/full_text_parser/mod.rs | 8 ++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/constants.rs b/src/constants.rs index c5f93f4..18c3069 100644 --- a/src/constants.rs +++ b/src/constants.rs @@ -73,8 +73,6 @@ pub const UNLIKELY_ROLES: &[&str] = &[ pub const DEFAULT_TAGS_TO_SCORE: &[&str] = &["SECTION", "H2", "H3", "H4", "H5", "H6", "P", "TD", "PRE"]; -pub const DEPRECATED_SIZE_ATTRIBUTE_ELEMS: Lazy> = - Lazy::new(|| HashSet::from(["TABLE", "TH", "TD", "HR", "PRE"])); pub const PRESENTATIONAL_ATTRIBUTES: &[&str] = &[ "align", "background", @@ -89,6 +87,8 @@ pub const PRESENTATIONAL_ATTRIBUTES: &[&str] = &[ "valign", "vspace", ]; +pub static DEPRECATED_SIZE_ATTRIBUTE_ELEMS: Lazy> = + Lazy::new(|| HashSet::from(["TABLE", "TH", "TD", "HR", "PRE"])); pub static DIV_TO_P_ELEMS: Lazy> = Lazy::new(|| { HashSet::from([ "BLOCKQUOTE", diff --git a/src/full_text_parser/mod.rs b/src/full_text_parser/mod.rs index d7e7bef..c8412ca 100644 --- a/src/full_text_parser/mod.rs +++ b/src/full_text_parser/mod.rs @@ -855,9 +855,7 @@ impl FullTextParser { Ok(()) } - pub(crate) fn post_process_document( - document: &Document - ) -> Result<(), FullTextParserError> { + pub(crate) fn post_process_document(document: &Document) -> Result<(), FullTextParserError> { if let Some(mut root) = document.get_root_element() { Self::simplify_nested_elements(&mut root)?; @@ -869,9 +867,7 @@ impl FullTextParser { Ok(()) } - pub(crate) fn post_process_page( - node: &mut Node, - ) -> Result<(), FullTextParserError> { + pub(crate) fn post_process_page(node: &mut Node) -> Result<(), FullTextParserError> { Util::clean_conditionally(node, "fieldset"); Util::clean_conditionally(node, "table"); Util::clean_conditionally(node, "ul");