Skip to content

Commit

Permalink
Merge pull request #182 from jugglerchris/fix_build_1.72
Browse files Browse the repository at this point in the history
Fix builds with Rust 1.72, and update for 0.13.2.
  • Loading branch information
jugglerchris authored Oct 18, 2024
2 parents 00acd18 + 11304a3 commit a584882
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ jobs:
steps:
- checkout
- run: cargo --version
- run: cargo build
# - run: cargo test
- run: cargo build --features=css
- run: cargo test --features=css
build-windows:
executor:
name: win/default
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ Possible log types:

### Latest

### 0.13.2

- [fixed] Fixed errors when building with Rust 1.72.

### 0.13.1

- [added] html2text now has --show-dom
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "html2text"
version = "0.13.1"
version = "0.13.2"
authors = ["Chris Emerson <[email protected]>"]
description = "Render HTML as plain text."
repository = "https://github.com/jugglerchris/rust-html2text/"
Expand Down
22 changes: 11 additions & 11 deletions src/css/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use nom::{
};

#[derive(Debug, PartialEq)]
pub enum Colour {
pub(crate) enum Colour {
Rgb(u8, u8, u8),
}

Expand All @@ -27,7 +27,7 @@ impl From<Colour> for crate::Colour {
}

#[derive(Debug, PartialEq)]
pub enum LengthUnit {
pub(crate) enum LengthUnit {
// Absolute units
In,
Cm,
Expand All @@ -41,15 +41,15 @@ pub enum LengthUnit {
}

#[derive(Debug, PartialEq)]
pub enum Height {
pub(crate) enum Height {
#[allow(unused)]
Auto,
// If the length is 0, the unit will be Px
Length(f32, LengthUnit),
}

#[derive(Debug, PartialEq)]
pub enum Overflow {
pub(crate) enum Overflow {
Visible,
Hidden,
Scroll,
Expand All @@ -58,14 +58,14 @@ pub enum Overflow {

#[non_exhaustive]
#[derive(Debug, PartialEq)]
pub enum Display {
pub(crate) enum Display {
None,
Other,
}

#[derive(Debug, PartialEq)]
#[non_exhaustive]
pub enum Decl {
pub(crate) enum Decl {
Color {
value: Colour,
},
Expand Down Expand Up @@ -160,7 +160,7 @@ struct RawValue<'s> {
}

#[derive(Debug, PartialEq)]
pub struct Declaration {
pub(crate) struct Declaration {
pub data: Decl,
pub important: Importance,
}
Expand All @@ -174,7 +174,7 @@ pub(crate) struct RuleSet {
}

#[derive(Debug, PartialEq)]
pub struct PropertyName(String);
pub(crate) struct PropertyName(String);

fn match_comment(text: &str) -> IResult<&str, ()> {
let (rest, _) = tag("/*")(text)?;
Expand Down Expand Up @@ -389,12 +389,12 @@ pub(crate) fn parse_color_attribute(
}

#[derive(Copy, Clone, PartialEq, Eq, Debug)]
pub enum Importance {
pub(crate) enum Importance {
Default,
Important,
}

pub fn parse_declaration(text: &str) -> IResult<&str, Option<Declaration>> {
pub(crate) fn parse_declaration(text: &str) -> IResult<&str, Option<Declaration>> {
let (rest, (prop, _ws1, _colon, _ws2, value)) = tuple((
parse_property_name,
skip_optional_whitespace,
Expand Down Expand Up @@ -723,7 +723,7 @@ fn parse_white_space(
Ok(WhiteSpace::Normal)
}

pub fn parse_rules(text: &str) -> IResult<&str, Vec<Declaration>> {
pub(crate) fn parse_rules(text: &str) -> IResult<&str, Vec<Declaration>> {
separated_list0(
tuple((tag(";"), skip_optional_whitespace)),
parse_declaration,
Expand Down

0 comments on commit a584882

Please sign in to comment.