Skip to content
Open
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 .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- nightly
- beta
- stable
- 1.63.0
- 1.66.0
features:
-
- --features dummy_match_byte
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ readme = "README.md"
keywords = ["css", "syntax", "parser"]
license = "MPL-2.0"
edition = "2018"
rust-version = "1.63"
rust-version = "1.66"

exclude = ["src/css-parsing-tests/**", "src/big-data-url.css"]

Expand All @@ -23,7 +23,7 @@ encoding_rs = "0.8"
cssparser-macros = { path = "./macros", version = "0.6.1" }
dtoa-short = "0.3"
itoa = "1.0"
phf = { version = "0.11.2", features = ["macros"] }
phf = { version = "0.13.1", features = ["macros"] }
serde = { version = "1.0", features = ["derive"], optional = true }
malloc_size_of = { version = "0.1", default-features = false, optional = true }
smallvec = "1.0"
Expand Down
4 changes: 2 additions & 2 deletions macros/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ pub fn match_byte(input: TokenStream) -> TokenStream {
for (i, ref arm) in arms.iter().enumerate() {
let case_id = i + 1;
let index = case_id as isize;
let name = syn::Ident::new(&format!("Case{}", case_id), arm.span());
let name = syn::Ident::new(&format!("Case{case_id}"), arm.span());
let pat = &arm.pat;
parse_pat_to_table(pat, case_id as u8, &mut wildcard, &mut table);

Expand All @@ -177,7 +177,7 @@ pub fn match_byte(input: TokenStream) -> TokenStream {

let mut table_content = Vec::new();
for entry in table.iter() {
let name: syn::Path = syn::parse_str(&format!("Case::Case{}", entry)).unwrap();
let name: syn::Path = syn::parse_str(&format!("Case::Case{entry}")).unwrap();
table_content.push(name);
}
let table = quote::quote!(static __CASES: [Case; 256] = [#(#table_content),*];);
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ As a consequence, when calling another parsing function, either:

Examples:

```{rust,ignore}
```rust,ignore
// 'none' | <image>
fn parse_background_image(context: &ParserContext, input: &mut Parser)
-> Result<Option<Image>, ()> {
Expand All @@ -53,7 +53,7 @@ fn parse_background_image(context: &ParserContext, input: &mut Parser)
}
```

```{rust,ignore}
```rust,ignore
// [ <length> | <percentage> ] [ <length> | <percentage> ]?
fn parse_border_spacing(_context: &ParserContext, input: &mut Parser)
-> Result<(LengthOrPercentage, LengthOrPercentage), ()> {
Expand Down
6 changes: 3 additions & 3 deletions src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ impl fmt::Display for BasicParseErrorKind<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
BasicParseErrorKind::UnexpectedToken(token) => {
write!(f, "unexpected token: {:?}", token)
write!(f, "unexpected token: {token:?}")
}
BasicParseErrorKind::EndOfInput => write!(f, "unexpected end of input"),
BasicParseErrorKind::AtRuleInvalid(rule) => {
write!(f, "invalid @ rule encountered: '@{}'", rule)
write!(f, "invalid @ rule encountered: '@{rule}'")
}
BasicParseErrorKind::AtRuleBodyInvalid => write!(f, "invalid @ rule body encountered"),
BasicParseErrorKind::QualifiedRuleInvalid => {
Expand Down Expand Up @@ -295,7 +295,7 @@ impl BlockType {
///
/// The union of two sets can be obtained with the `|` operator. Example:
///
/// ```{rust,ignore}
/// ```rust,ignore
/// input.parse_until_before(Delimiter::CurlyBracketBlock | Delimiter::Semicolon)
/// ```
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
Expand Down
2 changes: 1 addition & 1 deletion src/serializer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ where
///
/// Typical usage:
///
/// ```{rust,ignore}
/// ```rust,ignore
/// fn write_foo<W>(foo: &Foo, dest: &mut W) -> fmt::Result where W: fmt::Write {
/// dest.write_str("\"")?;
/// {
Expand Down
2 changes: 1 addition & 1 deletion src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ fn delimiter_from_byte(b: &mut Bencher) {
}

#[cfg(feature = "bench")]
const BACKGROUND_IMAGE: &'static str = include_str!("big-data-url.css");
const BACKGROUND_IMAGE: &str = include_str!("big-data-url.css");

#[cfg(feature = "bench")]
#[bench]
Expand Down
2 changes: 1 addition & 1 deletion src/tokenizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ enum SeenStatus {

impl<'a> Tokenizer<'a> {
#[inline]
pub fn new(input: &str) -> Tokenizer {
pub fn new(input: &'a str) -> Self {
Tokenizer {
input,
position: 0,
Expand Down