Skip to content

Commit 7dd7d81

Browse files
authored
Merge branch 'serde-rs:master' into json_map_with_capacity
2 parents 1e20d34 + 2683b1a commit 7dd7d81

File tree

6 files changed

+19
-19
lines changed

6 files changed

+19
-19
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
matrix:
1818
os: [ubuntu, windows]
1919
steps:
20-
- uses: actions/checkout@v2
20+
- uses: actions/checkout@v3
2121
- uses: dtolnay/rust-toolchain@nightly
2222
- run: cargo test
2323
- run: cargo test --features preserve_order --tests -- --skip ui --exact
@@ -39,7 +39,7 @@ jobs:
3939
- rust: stable
4040
os: windows
4141
steps:
42-
- uses: actions/checkout@v2
42+
- uses: actions/checkout@v3
4343
- uses: dtolnay/rust-toolchain@master
4444
with:
4545
toolchain: ${{matrix.rust}}
@@ -68,12 +68,10 @@ jobs:
6868
name: Miri
6969
runs-on: ubuntu-latest
7070
env:
71-
MIRIFLAGS: "-Zmiri-tag-raw-pointers"
71+
MIRIFLAGS: -Zmiri-strict-provenance
7272
steps:
73-
- uses: actions/checkout@v2
74-
- uses: dtolnay/rust-toolchain@nightly
75-
with:
76-
components: miri
73+
- uses: actions/checkout@v3
74+
- uses: dtolnay/rust-toolchain@miri
7775
- run: cargo miri test
7876
- run: cargo miri test --features preserve_order,float_roundtrip,arbitrary_precision,raw_value
7977

@@ -82,7 +80,7 @@ jobs:
8280
runs-on: ubuntu-latest
8381
if: github.event_name != 'pull_request'
8482
steps:
85-
- uses: actions/checkout@v2
83+
- uses: actions/checkout@v3
8684
- uses: dtolnay/rust-toolchain@clippy
8785
- run: cargo clippy --tests -- -Dclippy::all -Dclippy::pedantic
8886
- run: cargo clippy --all-features --tests -- -Dclippy::all -Dclippy::pedantic
@@ -91,7 +89,7 @@ jobs:
9189
name: Documentation
9290
runs-on: ubuntu-latest
9391
steps:
94-
- uses: actions/checkout@v2
92+
- uses: actions/checkout@v3
9593
- uses: dtolnay/rust-toolchain@nightly
9694
- run: cargo doc --features raw_value,unbounded_depth
9795
env:
@@ -101,7 +99,7 @@ jobs:
10199
name: Fuzz
102100
runs-on: ubuntu-latest
103101
steps:
104-
- uses: actions/checkout@v2
102+
- uses: actions/checkout@v3
105103
- uses: dtolnay/rust-toolchain@nightly
106104
- run: cargo install cargo-fuzz --debug
107105
- run: cargo fuzz build -O

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "serde_json"
3-
version = "1.0.79" # remember to update html_root_url
3+
version = "1.0.81" # remember to update html_root_url
44
authors = ["Erick Tryzelaar <[email protected]>", "David Tolnay <[email protected]>"]
55
license = "MIT OR Apache-2.0"
66
description = "A JSON serialization file format"
@@ -14,7 +14,7 @@ rust-version = "1.36"
1414

1515
[dependencies]
1616
serde = { version = "1.0.100", default-features = false }
17-
indexmap = { version = "1.5", optional = true }
17+
indexmap = { version = "1.5.2", features = ["std"], optional = true }
1818
itoa = "1.0"
1919
ryu = "1.0"
2020

@@ -56,7 +56,7 @@ alloc = ["serde/alloc"]
5656
# Make serde_json::Map use a representation which maintains insertion order.
5757
# This allows data to be read into a Value and written back to a JSON string
5858
# while preserving the order of map keys in the input.
59-
preserve_order = ["indexmap"]
59+
preserve_order = ["indexmap", "std"]
6060

6161
# Use sufficient precision when parsing fixed precision floats from JSON to
6262
# ensure that they maintain accuracy when round-tripped through JSON. This comes

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@
300300
//! [macro]: https://docs.serde.rs/serde_json/macro.json.html
301301
//! [`serde-json-core`]: https://github.com/rust-embedded-community/serde-json-core
302302
303-
#![doc(html_root_url = "https://docs.rs/serde_json/1.0.79")]
303+
#![doc(html_root_url = "https://docs.rs/serde_json/1.0.81")]
304304
// Ignored clippy lints
305305
#![allow(
306306
clippy::collapsible_else_if,

src/map.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ impl Map<String, Value> {
193193
}
194194
}
195195

196-
/// Moves all elements from other into Self, leaving other empty.
196+
/// Moves all elements from other into self, leaving other empty.
197197
#[inline]
198198
pub fn append(&mut self, other: &mut Self) {
199199
#[cfg(feature = "preserve_order")]

src/value/ser.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,9 @@ impl serde::Serializer for Serializer {
273273
})
274274
}
275275

276-
fn collect_str<T: ?Sized>(self, value: &T) -> Result<Value>
276+
fn collect_str<T>(self, value: &T) -> Result<Value>
277277
where
278-
T: Display,
278+
T: ?Sized + Display,
279279
{
280280
Ok(Value::String(value.to_string()))
281281
}
@@ -606,9 +606,9 @@ impl serde::Serializer for MapKeySerializer {
606606
Err(key_must_be_a_string())
607607
}
608608

609-
fn collect_str<T: ?Sized>(self, value: &T) -> Result<String>
609+
fn collect_str<T>(self, value: &T) -> Result<String>
610610
where
611-
T: Display,
611+
T: ?Sized + Display,
612612
{
613613
Ok(value.to_string())
614614
}

tests/regression/issue845.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(clippy::trait_duplication_in_bounds)] // https://github.com/rust-lang/rust-clippy/issues/8757
2+
13
use serde::{Deserialize, Deserializer};
24
use std::convert::TryFrom;
35
use std::fmt::{self, Display};

0 commit comments

Comments
 (0)