Skip to content

Commit

Permalink
Fix compilation without chrono (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
Caellian authored Nov 6, 2024
1 parent 564e3fc commit 16d7426
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@ jobs:
- uses: Swatinem/rust-cache@v2
- name: Format
run: cargo fmt --all -- --check
- name: Build
- name: Build minimal
run: cargo build --verbose --no-default-features
- name: Build with default features
run: cargo build --verbose
- name: Build with all features
run: cargo build --verbose --all-features
- name: Clippy
run: cargo clippy --all-features --all-targets -- -D warnings
- name: Run tests
Expand Down
3 changes: 2 additions & 1 deletion interpreter/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@ impl<'a> Default for Context<'a> {
#[cfg(feature = "regex")]
ctx.add_function("matches", functions::matches);

if cfg!(feature = "chrono") {
#[cfg(feature = "chrono")]
{
ctx.add_function("duration", functions::time::duration);
ctx.add_function("timestamp", functions::time::timestamp);
ctx.add_function("getFullYear", functions::time::timestamp_year);
Expand Down

0 comments on commit 16d7426

Please sign in to comment.