Skip to content

Commit dfb81ce

Browse files
authored
Fix errors in CI. (#540)
* Add missing feature. * Allow unused methods in test code. * Fix format string. * Fix tracing macro definition.
1 parent 9089fc7 commit dfb81ce

File tree

5 files changed

+15
-8
lines changed

5 files changed

+15
-8
lines changed

html5ever/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ build = "build.rs"
1111
categories = [ "parser-implementations", "web-programming" ]
1212
edition = "2021"
1313

14+
[features]
15+
trace_tokenizer = []
16+
1417
[dependencies]
1518
log = "0.4"
1619
mac = "0.1"

html5ever/src/tokenizer/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -616,13 +616,13 @@ macro_rules! shorthand (
616616

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

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

628628
// A little DSL for sequencing shorthand actions.

rcdom/tests/xml-tokenizer.rs

+1
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ fn tokenize_xml(input: Vec<StrTendril>, opts: XmlTokenizerOpts) -> Vec<Token> {
140140
tok.sink.get_tokens()
141141
}
142142

143+
#[allow(dead_code)]
143144
trait JsonExt: Sized {
144145
fn get_str(&self) -> String;
145146
fn get_tendril(&self) -> StrTendril;

xml5ever/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ exclude = ["xml5lib-tests/*"]
1313
categories = ["parser-implementations", "web-programming"]
1414
edition = "2021"
1515

16+
[features]
17+
trace_tokenizer = []
18+
1619
[dependencies]
1720
log = "0.4"
1821
mac = "0.1"

xml5ever/src/tokenizer/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -546,13 +546,13 @@ macro_rules! shorthand (
546546

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

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

558558
// A little DSL for sequencing shorthand actions.

0 commit comments

Comments
 (0)