Skip to content

Commit 35a8b56

Browse files
committed
chore: Apply review feedback
- fix: `HashMap` => `Map` to avoid compilation error Original author: MGlolenstine - fix: `Integer` => `I64` `ValueKind` enum has changed since the original PR went stale. - chore: Version bump `serde_dhall` to `0.12` Signed-off-by: Brennan Kinney <[email protected]>
1 parent fe1b043 commit 35a8b56

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ yaml-rust = { version = "0.4", optional = true }
3737
rust-ini = { version = "0.19", optional = true }
3838
ron = { version = "0.8", optional = true }
3939
json5_rs = { version = "0.4", optional = true, package = "json5" }
40-
serde_dhall = { version = "0.10", optional = true }
40+
serde_dhall = { version = "0.12", optional = true }
4141
indexmap = { version = "2.0.0", features = ["serde"], optional = true }
4242
convert_case = { version = "0.6", optional = true }
4343
pathdiff = "0.2"

src/file/format/dhall.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::collections::HashMap;
1+
use crate::map::Map;
22
use std::error::Error;
33

44
use crate::{
@@ -10,13 +10,13 @@ use crate::{
1010
pub fn parse(
1111
uri: Option<&String>,
1212
text: &str,
13-
) -> Result<HashMap<String, Value>, Box<dyn Error + Send + Sync>> {
13+
) -> Result<Map<String, Value>, Box<dyn Error + Send + Sync>> {
1414
let value = from_dhall_value(uri, serde_dhall::from_str(text).parse()?);
1515
match value.kind {
1616
ValueKind::Table(map) => Ok(map),
1717
ValueKind::Nil => Err(Unexpected::Unit),
1818
ValueKind::Boolean(value) => Err(Unexpected::Bool(value)),
19-
ValueKind::Integer(value) => Err(Unexpected::Integer(value)),
19+
ValueKind::I64(value) => Err(Unexpected::I64(value)),
2020
ValueKind::Float(value) => Err(Unexpected::Float(value)),
2121
ValueKind::String(value) => Err(Unexpected::Str(value)),
2222
ValueKind::Array(value) => Err(Unexpected::Seq),
@@ -29,8 +29,8 @@ fn from_dhall_value(uri: Option<&String>, value: serde_dhall::SimpleValue) -> Va
2929
match value {
3030
serde_dhall::SimpleValue::Num(num) => match num {
3131
serde_dhall::NumKind::Bool(b) => Value::new(uri, ValueKind::Boolean(b)),
32-
serde_dhall::NumKind::Natural(n) => Value::new(uri, ValueKind::Integer(n as i64)),
33-
serde_dhall::NumKind::Integer(i) => Value::new(uri, ValueKind::Integer(i)),
32+
serde_dhall::NumKind::Natural(n) => Value::new(uri, ValueKind::I64(n as i64)),
33+
serde_dhall::NumKind::Integer(i) => Value::new(uri, ValueKind::I64(i)),
3434
serde_dhall::NumKind::Double(d) => Value::new(uri, ValueKind::Float(f64::from(d))),
3535
},
3636
serde_dhall::SimpleValue::Text(string) => Value::new(uri, ValueKind::String(string)),

0 commit comments

Comments
 (0)