Skip to content

Commit

Permalink
Fix errors in CI. (#540)
Browse files Browse the repository at this point in the history
* Add missing feature.

* Allow unused methods in test code.

* Fix format string.

* Fix tracing macro definition.
  • Loading branch information
jdm authored Jun 5, 2024
1 parent 9089fc7 commit dfb81ce
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
3 changes: 3 additions & 0 deletions html5ever/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ build = "build.rs"
categories = [ "parser-implementations", "web-programming" ]
edition = "2021"

[features]
trace_tokenizer = []

[dependencies]
log = "0.4"
mac = "0.1"
Expand Down
8 changes: 4 additions & 4 deletions html5ever/src/tokenizer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -616,13 +616,13 @@ macro_rules! shorthand (

// Tracing of tokenizer actions. This adds significant bloat and compile time,
// so it's behind a cfg flag.
#[cfg(trace_tokenizer)]
#[cfg(feature = "trace_tokenizer")]
macro_rules! sh_trace ( ( $me:ident : $($cmds:tt)* ) => ({
trace!(" {:s}", stringify!($($cmds)*));
shorthand!($me:expr : $($cmds)*);
trace!(" {:?}", stringify!($($cmds)*));
shorthand!($me : $($cmds)*);
}));

#[cfg(not(trace_tokenizer))]
#[cfg(not(feature = "trace_tokenizer"))]
macro_rules! sh_trace ( ( $me:ident : $($cmds:tt)* ) => ( shorthand!($me: $($cmds)*) ) );

// A little DSL for sequencing shorthand actions.
Expand Down
1 change: 1 addition & 0 deletions rcdom/tests/xml-tokenizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ fn tokenize_xml(input: Vec<StrTendril>, opts: XmlTokenizerOpts) -> Vec<Token> {
tok.sink.get_tokens()
}

#[allow(dead_code)]
trait JsonExt: Sized {
fn get_str(&self) -> String;
fn get_tendril(&self) -> StrTendril;
Expand Down
3 changes: 3 additions & 0 deletions xml5ever/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ exclude = ["xml5lib-tests/*"]
categories = ["parser-implementations", "web-programming"]
edition = "2021"

[features]
trace_tokenizer = []

[dependencies]
log = "0.4"
mac = "0.1"
Expand Down
8 changes: 4 additions & 4 deletions xml5ever/src/tokenizer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -546,13 +546,13 @@ macro_rules! shorthand (

// Tracing of tokenizer actions. This adds significant bloat and compile time,
// so it's behind a cfg flag.
#[cfg(trace_tokenizer)]
#[cfg(feature = "trace_tokenizer")]
macro_rules! sh_trace ( ( $me:ident : $($cmds:tt)* ) => ({
debug!(" {:s}", stringify!($($cmds)*));
shorthand!($me:expr : $($cmds)*);
debug!(" {:?}", stringify!($($cmds)*));
shorthand!($me : $($cmds)*);
}));

#[cfg(not(trace_tokenizer))]
#[cfg(not(feature = "trace_tokenizer"))]
macro_rules! sh_trace ( ( $me:ident : $($cmds:tt)* ) => ( shorthand!($me: $($cmds)*) ) );

// A little DSL for sequencing shorthand actions.
Expand Down

0 comments on commit dfb81ce

Please sign in to comment.