Skip to content

Commit 1328234

Browse files
author
Dean Karn
committed
Allow string coerce or array and object
1 parent 61deec1 commit 1328234

File tree

3 files changed

+11
-13
lines changed

3 files changed

+11
-13
lines changed

.github/workflows/rust.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
platform: [ubuntu-latest, macos-latest, windows-latest]
1717
runs-on: ${{ matrix.platform }}
1818
steps:
19-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
2020
- uses: dtolnay/rust-toolchain@stable
2121
- run: cargo test --all-features --all-targets
2222

@@ -26,14 +26,14 @@ jobs:
2626
platform: [ ubuntu-latest, macos-latest, windows-latest ]
2727
runs-on: ${{ matrix.platform }}
2828
steps:
29-
- uses: actions/checkout@v3
29+
- uses: actions/checkout@v4
3030
- uses: dtolnay/rust-toolchain@stable
3131
- run: cargo check --all-features --all-targets
3232

3333
clippy:
3434
name: Clippy
3535
runs-on: ubuntu-latest
3636
steps:
37-
- uses: actions/checkout@v3
37+
- uses: actions/checkout@v4
3838
- uses: dtolnay/rust-toolchain@clippy
3939
- run: cargo clippy --all-features --tests -- -Dclippy::all -Dclippy::pedantic

Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ keywords = [
1616
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1717

1818
[dependencies]
19-
anydate = "0.3.0"
20-
anyhow = "1.0.75"
21-
chrono = { version = "0.4.31", features = ["serde"] }
22-
clap = { version = "4.4.7", features = ["derive"] }
19+
anydate = "0.4.0"
20+
anyhow = "1.0.83"
21+
chrono = { version = "0.4.38", features = ["serde"] }
22+
clap = { version = "4.5.4", features = ["derive"] }
2323
gjson = "0.8.1"
24-
serde = { version = "1.0.192", features = ["derive"] }
25-
serde_json = "1.0.108"
26-
thiserror = "1.0.50"
24+
serde = { version = "1.0.201", features = ["derive"] }
25+
serde_json = "1.0.117"
26+
thiserror = "1.0.60"
2727

2828
[dev-dependencies]
2929
criterion = { version = "0.5.1", features = ["html_reports"] }

src/parser.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -776,9 +776,7 @@ impl Expression for COERCEString {
776776
Value::DateTime(dt) => Ok(Value::String(
777777
dt.to_rfc3339_opts(SecondsFormat::AutoSi, true),
778778
)),
779-
_ => Err(Error::UnsupportedCOERCE(
780-
format!("{value} COERCE datetime",),
781-
)),
779+
Value::Array(_)|Value::Object(_) => {Ok(Value::String(value.to_string()))}
782780
}
783781
}
784782
}

0 commit comments

Comments
 (0)