From ac903d0e9059e7a1db7ed7303fb82988db771587 Mon Sep 17 00:00:00 2001 From: Amos Wenger Date: Fri, 13 Sep 2024 11:11:36 +0200 Subject: [PATCH] Check with bigint disabled --- .pre-commit-config.yaml | 6 ++++++ crates/jiter/src/value.rs | 2 ++ 2 files changed, 8 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d945080..4af770d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,6 +25,12 @@ repos: types: [rust] language: system pass_filenames: false + - id: check-without-num-bigint + name: Check without num-bigint feature + entry: cargo check --no-default-features --package jiter + types: [rust] + language: system + pass_filenames: false - id: test name: Test entry: cargo test --test main diff --git a/crates/jiter/src/value.rs b/crates/jiter/src/value.rs index 2a13bca..4771a2b 100644 --- a/crates/jiter/src/value.rs +++ b/crates/jiter/src/value.rs @@ -309,6 +309,7 @@ fn take_value_recursive<'j, 's>( })?; match n { NumberAny::Int(NumberInt::Int(int)) => JsonValue::Int(int), + #[cfg(feature = "num-bigint")] NumberAny::Int(NumberInt::BigInt(big_int)) => JsonValue::BigInt(big_int), NumberAny::Float(float) => JsonValue::Float(float), } @@ -386,6 +387,7 @@ fn take_value_recursive<'j, 's>( })?; match n { NumberAny::Int(NumberInt::Int(int)) => JsonValue::Int(int), + #[cfg(feature = "num-bigint")] NumberAny::Int(NumberInt::BigInt(big_int)) => JsonValue::BigInt(big_int), NumberAny::Float(float) => JsonValue::Float(float), }