summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2022-07-26 21:24:56 -0400
committerGitHub <noreply@github.com>2022-07-26 21:24:56 -0400
commitffd74cb1a1344e79fb1312349f6e7b4156950d71 (patch)
treebdd87ec70400d392568a85d54cb42e03a813bd18
parentb4b4e5980be5e49211673b4d01c9f7d04f8572d4 (diff)
chore: update jsonc_parser to 0.20 (#15316)
-rw-r--r--Cargo.lock8
-rw-r--r--cli/Cargo.toml4
-rw-r--r--cli/args/config_file.rs35
-rw-r--r--cli/tools/vendor/mod.rs4
4 files changed, 27 insertions, 24 deletions
diff --git a/Cargo.lock b/Cargo.lock
index c3e84f40b..d0e8aeecd 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1371,9 +1371,9 @@ dependencies = [
[[package]]
name = "dprint-plugin-json"
-version = "0.15.3"
+version = "0.15.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f1e5fe967adc699073aa92ce4c931de1932ee58f4b755c3b32fed15580636558"
+checksum = "db127f7ccb9b497b5b32e5e8eca4b19a7f191e38a3505195f029d5fbb728e51a"
dependencies = [
"anyhow",
"dprint-core",
@@ -2342,9 +2342,9 @@ dependencies = [
[[package]]
name = "jsonc-parser"
-version = "0.19.0"
+version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "34bbb0cd324c4ed32861be1d00c58635b94d03a2d2c70f6aec5f1a419c532783"
+checksum = "ccff81ff106af12c93c06935c50ee0723325095e8cbb8c0b41ed276b9469c4cb"
dependencies = [
"serde_json",
]
diff --git a/cli/Cargo.toml b/cli/Cargo.toml
index f38a8e651..254d165c3 100644
--- a/cli/Cargo.toml
+++ b/cli/Cargo.toml
@@ -63,7 +63,7 @@ clap_complete = "=3.1.2"
clap_complete_fig = "=3.1.5"
data-url = "=0.1.1"
dissimilar = "=1.0.3"
-dprint-plugin-json = "=0.15.3"
+dprint-plugin-json = "=0.15.4"
dprint-plugin-markdown = "=0.13.3"
dprint-plugin-typescript = "=0.71.1"
encoding_rs = "=0.8.31"
@@ -73,7 +73,7 @@ fancy-regex = "=0.9.0"
http = "=0.2.6"
import_map = "=0.12.1"
indexmap = "1.8.1"
-jsonc-parser = { version = "=0.19.0", features = ["serde"] }
+jsonc-parser = { version = "=0.20.0", features = ["serde"] }
libc = "=0.2.126"
log = { version = "=0.4.17", features = ["serde"] }
mitata = '=0.0.7'
diff --git a/cli/args/config_file.rs b/cli/args/config_file.rs
index bead2a284..1739309ff 100644
--- a/cli/args/config_file.rs
+++ b/cli/args/config_file.rs
@@ -557,23 +557,24 @@ impl ConfigFile {
text: &str,
specifier: &ModuleSpecifier,
) -> Result<Self, AnyError> {
- let jsonc = match jsonc_parser::parse_to_serde_value(text) {
- Ok(None) => json!({}),
- Ok(Some(value)) if value.is_object() => value,
- Ok(Some(_)) => {
- return Err(anyhow!(
- "config file JSON {:?} should be an object",
- specifier,
- ))
- }
- Err(e) => {
- return Err(anyhow!(
- "Unable to parse config file JSON {:?} because of {}",
- specifier,
- e.to_string()
- ))
- }
- };
+ let jsonc =
+ match jsonc_parser::parse_to_serde_value(text, &Default::default()) {
+ Ok(None) => json!({}),
+ Ok(Some(value)) if value.is_object() => value,
+ Ok(Some(_)) => {
+ return Err(anyhow!(
+ "config file JSON {:?} should be an object",
+ specifier,
+ ))
+ }
+ Err(e) => {
+ return Err(anyhow!(
+ "Unable to parse config file JSON {:?} because of {}",
+ specifier,
+ e.to_string()
+ ))
+ }
+ };
let json: ConfigFileJson = serde_json::from_value(jsonc)?;
Ok(Self {
diff --git a/cli/tools/vendor/mod.rs b/cli/tools/vendor/mod.rs
index a7b26aa79..a81965a15 100644
--- a/cli/tools/vendor/mod.rs
+++ b/cli/tools/vendor/mod.rs
@@ -203,7 +203,9 @@ fn update_config_text(
) -> Option<String> {
use jsonc_parser::ast::ObjectProp;
use jsonc_parser::ast::Value;
- let ast = jsonc_parser::parse_to_ast(text, &Default::default()).ok()?;
+ let ast =
+ jsonc_parser::parse_to_ast(text, &Default::default(), &Default::default())
+ .ok()?;
let obj = match ast.value {
Some(Value::Object(obj)) => obj,
_ => return None, // shouldn't happen, so ignore