diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c487c828..0804a0ed 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,7 +18,7 @@ jobs: - nightly - beta - stable - - 1.71.0 + - 1.85.0 features: - - --no-default-features diff --git a/Cargo.toml b/Cargo.toml index ffd060c7..25de0a19 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ readme = "README.md" keywords = ["css", "syntax", "parser"] license = "MPL-2.0" edition = "2018" -rust-version = "1.71" +rust-version = "1.85" exclude = ["src/css-parsing-tests/**", "src/big-data-url.css"] @@ -22,7 +22,7 @@ smallvec = "1.0" # Optional dependencies cssparser-macros = { path = "./macros", version = "0.7.0", optional = true } malloc_size_of = { version = "0.1", default-features = false, optional = true } -phf = { version = "0.13.1", features = ["macros"], optional = true } +phf = { version = "0.14.0", features = ["macros"], optional = true } serde = { version = "1.0", features = ["derive"], optional = true } [dev-dependencies] diff --git a/color/Cargo.toml b/color/Cargo.toml index 0a3f8854..93e35b44 100644 --- a/color/Cargo.toml +++ b/color/Cargo.toml @@ -7,7 +7,7 @@ documentation = "https://docs.rs/cssparser-color/" repository = "https://github.com/servo/rust-cssparser" license = "MPL-2.0" edition = "2021" -rust-version = "1.71" +rust-version = "1.85" [lib] path = "lib.rs" @@ -19,6 +19,8 @@ serde = { version = "1.0", features = ["derive"], optional = true } [features] default = ["cssparser/default"] serde = ["cssparser/serde", "dep:serde"] +# Useful for skipping tests when execution is slow, e.g., under miri +skip_long_tests = [] [dev-dependencies] serde_json = "1.0.25" diff --git a/color/lib.rs b/color/lib.rs index 5b116c23..c7795823 100644 --- a/color/lib.rs +++ b/color/lib.rs @@ -464,7 +464,7 @@ where /// floating point values. struct ModernComponent<'a>(&'a Option); -impl<'a> ToCss for ModernComponent<'a> { +impl ToCss for ModernComponent<'_> { fn to_css(&self, dest: &mut W) -> fmt::Result where W: fmt::Write, @@ -1041,7 +1041,7 @@ pub trait ColorParser<'i> { /// Default implementation of a [`ColorParser`] pub struct DefaultColorParser; -impl<'i> ColorParser<'i> for DefaultColorParser { +impl ColorParser<'_> for DefaultColorParser { type Output = Color; type Error = (); } diff --git a/color/tests.rs b/color/tests.rs index d8d8e5d4..98db40a3 100644 --- a/color/tests.rs +++ b/color/tests.rs @@ -69,8 +69,7 @@ fn run_json_tests Value>(json_data: &str, parse: F) { } fn run_color_tests) -> Value>(json_data: &str, to_json: F) { run_json_tests(json_data, |input| { - let result: Result<_, ParseError<()>> = - input.parse_entirely(|i| Color::parse(i).map_err(Into::into)); + let result: Result<_, ParseError<()>> = input.parse_entirely(|i| Color::parse(i)); to_json(result.map_err(|_| ())) }); } @@ -317,7 +316,7 @@ fn generic_parser() { } struct TestColorParser; - impl<'i> ColorParser<'i> for TestColorParser { + impl ColorParser<'_> for TestColorParser { type Output = OutputType; type Error = (); } diff --git a/src/tests.rs b/src/tests.rs index 5845cdd1..1c4ef711 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -52,11 +52,10 @@ fn normalize(json: &mut Value) { normalize(item) } } - Value::String(ref mut s) => { - if *s == "extra-input" || *s == "empty" { - *s = "invalid".to_string() - } + Value::String(ref mut s) if *s == "extra-input" || *s == "empty" => { + *s = "invalid".to_string() } + _ => {} } }