Skip to content

Commit

Permalink
html5ever: prepare 0.26.1 release (#516)
Browse files Browse the repository at this point in the history
* Warn on unreachable_pub to make it more obvious if API is private

* Only check library dependencies against MSRV

* Bump crate versions

Need semver-incompatible bump after a phf bump in markup5ever.
  • Loading branch information
djc authored Mar 20, 2024
1 parent c044930 commit 16443ce
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 23 deletions.
15 changes: 14 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
version: [1.60.0, stable, beta, nightly]
version: [stable, beta, nightly]
steps:
- uses: actions/checkout@v3

Expand Down Expand Up @@ -44,6 +44,19 @@ jobs:
if: matrix.version == 'nightly'
run: cargo doc

msrv:
name: MSRV
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install stable toolchain
run: |
rustup set profile minimal
rustup override set 1.60.0
- run: cargo check --lib --all-features

build_result:
name: Result
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions html5ever/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]

name = "html5ever"
version = "0.26.0"
version = "0.27.0"
authors = [ "The html5ever Project Developers" ]
license = "MIT OR Apache-2.0"
repository = "https://github.com/servo/html5ever"
Expand All @@ -14,7 +14,7 @@ edition = "2021"
[dependencies]
log = "0.4"
mac = "0.1"
markup5ever = { version = "0.11", path = "../markup5ever" }
markup5ever = { version = "0.12", path = "../markup5ever" }

[dev-dependencies]
typed-arena = "2.0.2"
Expand Down
3 changes: 2 additions & 1 deletion html5ever/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#![crate_type = "dylib"]
#![cfg_attr(test, deny(warnings))]
#![allow(unused_parens)]
#![warn(unreachable_pub)]

pub use driver::{parse_document, parse_fragment, ParseOpts, Parser};
pub use markup5ever::*;
Expand All @@ -21,7 +22,7 @@ pub use serialize::serialize;
mod macros;

mod util {
pub mod str;
pub(crate) mod str;
}

pub mod driver;
Expand Down
20 changes: 10 additions & 10 deletions html5ever/src/tokenizer/char_ref/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@ use std::borrow::Cow::Borrowed;
use std::char::from_u32;

use self::State::*;
pub use self::Status::*;
pub(super) use self::Status::*;

//§ tokenizing-character-references
pub struct CharRef {
pub(super) struct CharRef {
/// The resulting character(s)
pub chars: [char; 2],
pub(super) chars: [char; 2],

/// How many slots in `chars` are valid?
pub num_chars: u8,
pub(super) num_chars: u8,
}

pub enum Status {
pub(super) enum Status {
Stuck,
Progress,
Done,
Expand All @@ -45,7 +45,7 @@ enum State {
BogusName,
}

pub struct CharRefTokenizer {
pub(super) struct CharRefTokenizer {
state: State,
result: Option<CharRef>,
is_consumed_in_attribute: bool,
Expand All @@ -61,7 +61,7 @@ pub struct CharRefTokenizer {
}

impl CharRefTokenizer {
pub fn new(is_consumed_in_attribute: bool) -> CharRefTokenizer {
pub(super) fn new(is_consumed_in_attribute: bool) -> CharRefTokenizer {
CharRefTokenizer {
is_consumed_in_attribute,
state: Begin,
Expand All @@ -78,7 +78,7 @@ impl CharRefTokenizer {

// A CharRefTokenizer can only tokenize one character reference,
// so this method consumes the tokenizer.
pub fn get_result(self) -> CharRef {
pub(super) fn get_result(self) -> CharRef {
self.result.expect("get_result called before done")
}

Expand Down Expand Up @@ -112,7 +112,7 @@ impl CharRefTokenizer {
}

impl CharRefTokenizer {
pub fn step<Sink: TokenSink>(
pub(super) fn step<Sink: TokenSink>(
&mut self,
tokenizer: &mut Tokenizer<Sink>,
input: &mut BufferQueue,
Expand Down Expand Up @@ -411,7 +411,7 @@ impl CharRefTokenizer {
self.finish_none()
}

pub fn end_of_file<Sink: TokenSink>(
pub(super) fn end_of_file<Sink: TokenSink>(
&mut self,
tokenizer: &mut Tokenizer<Sink>,
input: &mut BufferQueue,
Expand Down
4 changes: 2 additions & 2 deletions html5ever/src/util/str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@

use std::fmt;

pub fn to_escaped_string<T: fmt::Debug>(x: &T) -> String {
pub(crate) fn to_escaped_string<T: fmt::Debug>(x: &T) -> String {
// FIXME: don't allocate twice
let string = format!("{:?}", x);
string.chars().flat_map(|c| c.escape_default()).collect()
}

/// If `c` is an ASCII letter, return the corresponding lowercase
/// letter, otherwise None.
pub fn lower_ascii_letter(c: char) -> Option<char> {
pub(crate) fn lower_ascii_letter(c: char) -> Option<char> {
match c {
'a'..='z' => Some(c),
'A'..='Z' => Some((c as u8 - b'A' + b'a') as char),
Expand Down
2 changes: 1 addition & 1 deletion markup5ever/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "markup5ever"
version = "0.11.0"
version = "0.12.0"
authors = [ "The html5ever Project Developers" ]
license = "MIT OR Apache-2.0"
repository = "https://github.com/servo/html5ever"
Expand Down
8 changes: 4 additions & 4 deletions rcdom/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "markup5ever_rcdom"
version = "0.2.0"
version = "0.3.0"
authors = [ "The html5ever Project Developers" ]
license = "MIT OR Apache-2.0"
repository = "https://github.com/servo/html5ever"
Expand All @@ -16,9 +16,9 @@ path = "lib.rs"

[dependencies]
tendril = "0.4"
html5ever = { version = "0.26", path = "../html5ever" }
markup5ever = { version = "0.11", path = "../markup5ever" }
xml5ever = { version = "0.17", path = "../xml5ever" }
html5ever = { version = "0.27", path = "../html5ever" }
markup5ever = { version = "0.12", path = "../markup5ever" }
xml5ever = { version = "0.18", path = "../xml5ever" }

[dev-dependencies]
serde_json = "1.0"
Expand Down
4 changes: 2 additions & 2 deletions xml5ever/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]

name = "xml5ever"
version = "0.17.0"
version = "0.18.0"
authors = ["The xml5ever project developers"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/servo/html5ever"
Expand All @@ -18,7 +18,7 @@ edition = "2021"
[dependencies]
log = "0.4"
mac = "0.1"
markup5ever = {version = "0.11", path = "../markup5ever" }
markup5ever = {version = "0.12", path = "../markup5ever" }

[dev-dependencies]
rustc-test = "0.3"
Expand Down

0 comments on commit 16443ce

Please sign in to comment.