diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2022-07-26 21:24:56 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-26 21:24:56 -0400 |
commit | ffd74cb1a1344e79fb1312349f6e7b4156950d71 (patch) | |
tree | bdd87ec70400d392568a85d54cb42e03a813bd18 /cli/args | |
parent | b4b4e5980be5e49211673b4d01c9f7d04f8572d4 (diff) |
chore: update jsonc_parser to 0.20 (#15316)
Diffstat (limited to 'cli/args')
-rw-r--r-- | cli/args/config_file.rs | 35 |
1 files changed, 18 insertions, 17 deletions
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 { |