From a2ca90da64de8dc6d0943ed8c2850f48f4493a9f Mon Sep 17 00:00:00 2001 From: Diogo Sousa Date: Mon, 23 Dec 2024 20:38:49 +0000 Subject: [PATCH] Format the code. --- .gitignore | 1 + tests/fixtures/element_content_replacement.rs | 27 +++++++++---------- tests/fixtures/selector_matching.rs | 8 +++--- tests/fixtures/token_capturing.rs | 5 ++-- tests/harness/mod.rs | 1 - tests/integration_tests.rs | 4 +-- 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/.gitignore b/.gitignore index d2551165..f9828b9d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .DS_Store /.vscode/ +/.idea/ Cargo.lock target **/*.rs.bk diff --git a/tests/fixtures/element_content_replacement.rs b/tests/fixtures/element_content_replacement.rs index d52a072a..194caf14 100644 --- a/tests/fixtures/element_content_replacement.rs +++ b/tests/fixtures/element_content_replacement.rs @@ -1,8 +1,8 @@ use crate::harness::suites::selectors_tests::{get_test_cases, TestCase}; use crate::harness::TestFixture; -use lol_html::test_utils::Output; -use lol_html::{HtmlRewriter, Settings, element}; use lol_html::html_content::ContentType; +use lol_html::test_utils::Output; +use lol_html::{element, HtmlRewriter, Settings}; // NOTE: Inner element content replacement functionality used as a basis for // the multiple element methods and it's easy to get it wrong, so we have @@ -19,21 +19,20 @@ impl TestFixture for ElementContentReplacementTests { let mut output = Output::new(encoding.into()); { - let mut rewriter = HtmlRewriter::new(Settings { - element_content_handlers: vec![ - element!(test.selector, |el| { - el.set_inner_content( - &format!("", test.selector), - ContentType::Html, - ); - - Ok(()) - }) - ], + let mut rewriter = HtmlRewriter::new( + Settings { + element_content_handlers: vec![element!(test.selector, |el| { + el.set_inner_content( + &format!("", test.selector), + ContentType::Html, + ); + + Ok(()) + })], encoding, ..Settings::new() }, - |c: &[u8]| output.push(c) + |c: &[u8]| output.push(c), ); for chunk in test.input.chunks() { diff --git a/tests/fixtures/selector_matching.rs b/tests/fixtures/selector_matching.rs index 91fbfedd..1e1a4b04 100644 --- a/tests/fixtures/selector_matching.rs +++ b/tests/fixtures/selector_matching.rs @@ -1,8 +1,8 @@ use crate::harness::suites::selectors_tests::{get_test_cases, TestCase}; use crate::harness::TestFixture; -use lol_html::test_utils::Output; -use lol_html::{HtmlRewriter, Settings, element, comments, text}; use lol_html::html_content::ContentType; +use lol_html::test_utils::Output; +use lol_html::{comments, element, text, HtmlRewriter, Settings}; pub struct SelectorMatchingTests; @@ -65,12 +65,12 @@ impl TestFixture for SelectorMatchingTests { } Ok(()) - }) + }), ], encoding, ..Settings::new() }, - |c: &[u8]| output.push(c) + |c: &[u8]| output.push(c), ); for chunk in test.input.chunks() { diff --git a/tests/fixtures/token_capturing.rs b/tests/fixtures/token_capturing.rs index db58a251..bba9f8c2 100644 --- a/tests/fixtures/token_capturing.rs +++ b/tests/fixtures/token_capturing.rs @@ -4,8 +4,9 @@ use lol_html::errors::RewritingError; use lol_html::html_content::{DocumentEnd, TextType}; use lol_html::test_utils::Output; use lol_html::{ - LocalName, LocalNameHash, SharedMemoryLimiter, Namespace, SharedEncoding, StartTagHandlingResult, - Token, TokenCaptureFlags, TransformController, TransformStream, TransformStreamSettings, + LocalName, LocalNameHash, Namespace, SharedEncoding, SharedMemoryLimiter, + StartTagHandlingResult, Token, TokenCaptureFlags, TransformController, TransformStream, + TransformStreamSettings, }; macro_rules! expect_eql { diff --git a/tests/harness/mod.rs b/tests/harness/mod.rs index 65dbc5a4..28d72804 100644 --- a/tests/harness/mod.rs +++ b/tests/harness/mod.rs @@ -35,4 +35,3 @@ impl Drop for DumpOnPanic<'_, T> { eprintln!("test case failed: {:?}", self.0); } } - diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index 9c7b71aa..f6f451fc 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -4,7 +4,7 @@ mod harness; mod fixtures { - mod token_capturing; - mod selector_matching; mod element_content_replacement; + mod selector_matching; + mod token_capturing; }