diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 77d611a09..7e56d3cfe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: os: [ubuntu, windows] timeout-minutes: 45 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: dtolnay/rust-toolchain@nightly - run: cargo test - run: cargo test --features preserve_order --tests -- --skip ui --exact @@ -44,7 +44,7 @@ jobs: strategy: fail-fast: false matrix: - rust: [beta, 1.65.0, 1.56.1] + rust: [beta, 1.65.0, 1.61.0] os: [ubuntu] include: - rust: stable @@ -54,7 +54,7 @@ jobs: os: windows timeout-minutes: 45 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: dtolnay/rust-toolchain@master with: toolchain: ${{matrix.rust}} @@ -68,11 +68,12 @@ jobs: - run: cargo check --manifest-path tests/crate/Cargo.toml --no-default-features --features alloc,arbitrary_precision - run: cargo check --manifest-path tests/crate/Cargo.toml --no-default-features --features alloc,raw_value - run: cargo check --manifest-path tests/crate/Cargo.toml --features serde_json/preserve_order - if: matrix.rust != '1.56.1' + if: matrix.rust != '1.61.0' - run: cargo check --manifest-path tests/crate/Cargo.toml --no-default-features --features alloc,serde_json/preserve_order - if: matrix.rust != '1.56.1' + if: matrix.rust != '1.61.0' - name: Build without std - run: cargo check --manifest-path tests/crate/Cargo.toml --target ${{matrix.target}} --no-default-features --features alloc + run: cargo check --manifest-path tests/crate/Cargo.toml --target + ${{matrix.target}} --no-default-features --features alloc if: matrix.target minimal: @@ -80,7 +81,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 45 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: dtolnay/rust-toolchain@nightly - run: cargo generate-lockfile -Z minimal-versions - run: cargo check --locked @@ -104,7 +105,7 @@ jobs: MIRIFLAGS: -Zmiri-strict-provenance timeout-minutes: 45 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: dtolnay/rust-toolchain@miri - run: cargo miri setup - run: cargo miri test --target ${{matrix.target}} @@ -116,7 +117,7 @@ jobs: if: github.event_name != 'pull_request' timeout-minutes: 45 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: dtolnay/rust-toolchain@clippy - run: cargo clippy --tests -- -Dclippy::all -Dclippy::pedantic - run: cargo clippy --all-features --tests -- -Dclippy::all -Dclippy::pedantic @@ -128,7 +129,7 @@ jobs: env: RUSTDOCFLAGS: -Dwarnings steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: dtolnay/rust-toolchain@nightly - uses: dtolnay/install@cargo-docs-rs - run: cargo docs-rs @@ -138,7 +139,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 45 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: dtolnay/rust-toolchain@nightly - uses: dtolnay/install@cargo-fuzz - run: cargo fuzz check @@ -149,7 +150,7 @@ jobs: if: github.event_name != 'pull_request' timeout-minutes: 45 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: dtolnay/rust-toolchain@stable - uses: dtolnay/install@cargo-outdated - run: cargo outdated --exit-code 1 diff --git a/Cargo.toml b/Cargo.toml index 4e7a02723..49cd07273 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "serde_json" -version = "1.0.143" +version = "1.0.145" authors = ["Erick Tryzelaar ", "David Tolnay "] categories = ["encoding", "parser-implementations", "no-std"] description = "A JSON serialization file format" @@ -9,14 +9,17 @@ edition = "2021" keywords = ["json", "serde", "serialization"] license = "MIT OR Apache-2.0" repository = "https://github.com/serde-rs/json" -rust-version = "1.56" +rust-version = "1.61" [dependencies] indexmap = { version = "2.2.3", optional = true } itoa = "1.0" memchr = { version = "2", default-features = false } ryu = "1.0" -serde = { version = "1.0.194", default-features = false } +serde_core = { version = "1.0.220", default-features = false } + +[target.'cfg(any())'.dependencies] +serde = { version = "1.0.220", default-features = false } [dev-dependencies] automod = "1.0.11" @@ -27,7 +30,7 @@ serde = { version = "1.0.194", features = ["derive"] } serde_bytes = "0.11.10" serde_derive = "1.0.166" serde_stacker = "0.1.8" -trybuild = { version = "1.0.81", features = ["diff"] } +trybuild = { version = "1.0.108", features = ["diff"] } [package.metadata.docs.rs] features = ["preserve_order", "raw_value", "unbounded_depth"] @@ -48,12 +51,12 @@ features = ["float_roundtrip", "raw_value", "unbounded_depth"] [features] default = ["std"] -std = ["memchr/std", "serde/std"] +std = ["memchr/std", "serde_core/std"] # Provide integration for heap-allocated collections without depending on the # rest of the Rust standard library. # NOTE: Disabling both `std` *and* `alloc` features is not supported yet. -alloc = ["serde/alloc"] +alloc = ["serde_core/alloc"] # Make serde_json::Map use a representation which maintains insertion order. # This allows data to be read into a Value and written back to a JSON string diff --git a/src/lib.rs b/src/lib.rs index f77fa73f4..9669d70b7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -299,7 +299,7 @@ //! [macro]: crate::json //! [`serde-json-core`]: https://github.com/rust-embedded-community/serde-json-core -#![doc(html_root_url = "https://docs.rs/serde_json/1.0.143")] +#![doc(html_root_url = "https://docs.rs/serde_json/1.0.145")] // Ignored clippy lints #![allow( clippy::collapsible_else_if, @@ -320,6 +320,7 @@ clippy::transmute_ptr_to_ptr, clippy::unbuffered_bytes, clippy::unconditional_recursion, // https://github.com/rust-lang/rust-clippy/issues/12133 + clippy::uninlined_format_args, clippy::unnecessary_wraps )] // Ignored clippy_pedantic lints @@ -378,6 +379,8 @@ extern crate alloc; #[cfg(feature = "std")] extern crate std; +extern crate serde_core as serde; + // Not public API. Used from macro-generated code. #[doc(hidden)] pub mod __private { diff --git a/tests/debug.rs b/tests/debug.rs index 8ddcf5a38..adf475d93 100644 --- a/tests/debug.rs +++ b/tests/debug.rs @@ -1,3 +1,5 @@ +#![allow(clippy::uninlined_format_args)] + use indoc::indoc; use serde_json::{json, Number, Value}; diff --git a/tests/test.rs b/tests/test.rs index d41a2336a..f608679e6 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -11,6 +11,7 @@ clippy::let_underscore_untyped, clippy::shadow_unrelated, clippy::too_many_lines, + clippy::uninlined_format_args, clippy::unreadable_literal, clippy::unseparated_literal_suffix, clippy::vec_init_then_push,