Skip to content

Commit 87de954

Browse files
adetaylorvadimsht
authored andcommitted
[rust] Switch serde_jsonrc -> serde_json_lenient.
Formerly we used serde_jsonrc, a Rust JSON parser which accepts some format extensions. With this CL we switch to serde_json_lenient which is similar but more up to date with the upstream (strict) JSON parser serde_json. This is necessary so that we can get the benefit of the float_roundtrip mode recently introduced upstream. Beyond that, there are no intentional functional changes. This change appears large because previously, serde_jsonrc was pulled in via a DEPS entry. With this change, we vendor it into place like the rest of our crates. Hence, there are many "new" files though they are all largely identical to the serde_jsonrc which we previously pulled in via DEPS. A full diff of the changes can be seen via: https://github.com/google/serde_json_lenient/compare/ca5782632fc8dc3f9cf2f22055b87f910cad761f..01d0cf01520d3c5be23825ec979998fb80c780e6 most of which is due to upgrading to a more recent underlying serde_json. Bug: 1301719 Change-Id: If43f9f3900125c92cac9cbbc3749d31cb3085a3d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3511416 Reviewed-by: Alex Gough <[email protected]> Reviewed-by: Robert Sesek <[email protected]> Reviewed-by: Garrett Beaty <[email protected]> Commit-Queue: Adrian Taylor <[email protected]> Cr-Commit-Position: refs/heads/main@{#981383} NOKEYCHECK=True GitOrigin-RevId: bcee0eea9a2c12ff7d38c5dcaf44bc335d3de549
1 parent e27e32c commit 87de954

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+18122
-6
lines changed
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import("//build/rust/cargo_crate.gni")
66

77
cargo_crate("lib") {
8-
crate_name = "serde_jsonrc"
8+
crate_name = "serde_json_lenient"
99
epoch = "0.1"
1010
crate_type = "rlib"
1111
crate_root = "crate/src/lib.rs"
@@ -20,7 +20,10 @@ cargo_crate("lib") {
2020
"//third_party/rust/serde/v1:lib",
2121
]
2222
features = [
23+
"float_roundtrip",
2324
"std",
2425
"unbounded_depth",
2526
]
27+
build_root = "crate/build.rs"
28+
build_sources = [ "crate/build.rs" ]
2629
}
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
Name: serde_jsonrc
2-
URL: https://crates.io/crates/serde_jsonrc
1+
Name: serde_json_lenient
2+
URL: https://crates.io/crates/serde_json_lenient
33
Description: A lenient JSON serialization file format
4-
Version: 0.1.0
4+
Version: 0.1.4
55
Security Critical: yes
66
License: Apache 2.0
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"git": {
3+
"sha1": "01d0cf01520d3c5be23825ec979998fb80c780e6"
4+
},
5+
"path_in_vcs": ""
6+
}
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
2+
#
3+
# When uploading crates to the registry Cargo will automatically
4+
# "normalize" Cargo.toml files for maximal compatibility
5+
# with all versions of Cargo and also rewrite `path` dependencies
6+
# to registry (e.g., crates.io) dependencies.
7+
#
8+
# If you are reading this file be aware that the original Cargo.toml
9+
# will likely look very different (and much more reasonable).
10+
# See Cargo.toml.orig for the original contents.
11+
12+
[package]
13+
edition = "2018"
14+
rust-version = "1.31"
15+
name = "serde_json_lenient"
16+
version = "0.1.4"
17+
authors = [
18+
"Adrian Taylor <[email protected]>",
19+
"Michael Bolin <[email protected]>",
20+
"Erick Tryzelaar <[email protected]>",
21+
"David Tolnay <[email protected]>",
22+
]
23+
include = [
24+
"build.rs",
25+
"src/**/*.rs",
26+
"README.md",
27+
"LICENSE-APACHE",
28+
"LICENSE-MIT",
29+
]
30+
description = "A lenient JSON serialization file format"
31+
documentation = "https://docs.rs/serde_json_lenient/latest/"
32+
readme = "README.md"
33+
keywords = [
34+
"json",
35+
"serde",
36+
"serialization",
37+
]
38+
categories = ["encoding"]
39+
license = "MIT/Apache-2.0"
40+
repository = "https://github.com/google/serde_json_lenient"
41+
42+
[package.metadata.docs.rs]
43+
features = [
44+
"raw_value",
45+
"unbounded_depth",
46+
]
47+
targets = ["x86_64-unknown-linux-gnu"]
48+
rustdoc-args = [
49+
"--cfg",
50+
"docsrs",
51+
]
52+
53+
[package.metadata.playground]
54+
features = ["raw_value"]
55+
56+
[dependencies.indexmap]
57+
version = "1.5"
58+
optional = true
59+
60+
[dependencies.itoa]
61+
version = "0.4.3"
62+
default-features = false
63+
64+
[dependencies.ryu]
65+
version = "1.0"
66+
67+
[dependencies.serde]
68+
version = "1.0.100"
69+
default-features = false
70+
71+
[dev-dependencies.automod]
72+
version = "1.0"
73+
74+
[dev-dependencies.rustversion]
75+
version = "1.0"
76+
77+
[dev-dependencies.serde_bytes]
78+
version = "0.11"
79+
80+
[dev-dependencies.serde_derive]
81+
version = "1.0"
82+
83+
[dev-dependencies.serde_stacker]
84+
version = "0.1"
85+
86+
[dev-dependencies.trybuild]
87+
version = "1.0.49"
88+
features = ["diff"]
89+
90+
[features]
91+
alloc = ["serde/alloc"]
92+
arbitrary_precision = []
93+
default = ["std"]
94+
float_roundtrip = []
95+
preserve_order = ["indexmap"]
96+
raw_value = []
97+
std = ["serde/std"]
98+
unbounded_depth = []

serde_json_lenient/v0_1/crate/Cargo.toml.orig

Lines changed: 93 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)