Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cssparser"
version = "0.19.5"
version = "0.19.6"
authors = [ "Simon Sapin <simon.sapin@exyr.org>" ]

description = "Rust implementation of CSS Syntax Level 3"
Expand Down
6 changes: 6 additions & 0 deletions src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ pub enum BasicParseError<'a> {
}

impl<'a, T> From<BasicParseError<'a>> for ParseError<'a, T> {
#[inline]
fn from(this: BasicParseError<'a>) -> ParseError<'a, T> {
ParseError::Basic(this)
}
Expand Down Expand Up @@ -200,16 +201,19 @@ mod ClosingDelimiter {
impl BitOr<Delimiters> for Delimiters {
type Output = Delimiters;

#[inline]
fn bitor(self, other: Delimiters) -> Delimiters {
Delimiters { bits: self.bits | other.bits }
}
}

impl Delimiters {
#[inline]
fn contains(self, other: Delimiters) -> bool {
(self.bits & other.bits) != 0
}

#[inline]
fn from_byte(byte: Option<u8>) -> Delimiters {
match byte {
Some(b';') => Delimiter::Semicolon,
Expand Down Expand Up @@ -860,6 +864,8 @@ pub fn parse_nested_block<'i: 't, 't, F, T, E>(parser: &mut Parser<'i, 't>, pars
result
}

#[inline(never)]
#[cold]
fn consume_until_end_of_block(block_type: BlockType, tokenizer: &mut Tokenizer) {
let mut stack = SmallVec::<[BlockType; 16]>::new();
stack.push(block_type);
Expand Down