Skip to content

Commit

Permalink
Format the code.
Browse files Browse the repository at this point in the history
  • Loading branch information
orium authored and kornelski committed Dec 23, 2024
1 parent 6e2ba65 commit cd4f7d3
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 23 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.DS_Store
/.vscode/
/.idea/
Cargo.lock
target
**/*.rs.bk
27 changes: 13 additions & 14 deletions tests/fixtures/element_content_replacement.rs
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -19,21 +19,20 @@ impl TestFixture<TestCase> 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!("<!--Replaced ({}) -->", test.selector),
ContentType::Html,
);

Ok(())
})
],
let mut rewriter = HtmlRewriter::new(
Settings {
element_content_handlers: vec![element!(test.selector, |el| {
el.set_inner_content(
&format!("<!--Replaced ({}) -->", test.selector),
ContentType::Html,
);

Ok(())
})],
encoding,
..Settings::new()
},
|c: &[u8]| output.push(c)
|c: &[u8]| output.push(c),
);

for chunk in test.input.chunks() {
Expand Down
8 changes: 4 additions & 4 deletions tests/fixtures/selector_matching.rs
Original file line number Diff line number Diff line change
@@ -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;

Expand Down Expand Up @@ -65,12 +65,12 @@ impl TestFixture<TestCase> for SelectorMatchingTests {
}

Ok(())
})
}),
],
encoding,
..Settings::new()
},
|c: &[u8]| output.push(c)
|c: &[u8]| output.push(c),
);

for chunk in test.input.chunks() {
Expand Down
5 changes: 3 additions & 2 deletions tests/fixtures/token_capturing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 0 additions & 1 deletion tests/harness/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,3 @@ impl<T: std::fmt::Debug> Drop for DumpOnPanic<'_, T> {
eprintln!("test case failed: {:?}", self.0);
}
}

4 changes: 2 additions & 2 deletions tests/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
mod harness;

mod fixtures {
mod token_capturing;
mod selector_matching;
mod element_content_replacement;
mod selector_matching;
mod token_capturing;
}

0 comments on commit cd4f7d3

Please sign in to comment.