Skip to content

Commit 6baa18d

Browse files
committed
refactor: drop derivative dependency
Fixes: #179
1 parent a9a2382 commit 6baa18d

File tree

5 files changed

+15
-38
lines changed

5 files changed

+15
-38
lines changed

Cargo.lock

+8-31
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ hashbrown = "0.14.5"
7171
static_assertions = "1.1"
7272
rustc-hash = "1.1"
7373
num-bigint = "0.4.5"
74-
derivative = "2.2.0"
7574
strsim = "0.11.0"
7675
proc-macro2 = "1.0"
7776
quote = "1.0"

crates/jrsonnet-evaluator/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,4 @@ annotate-snippets = { workspace = true, optional = true }
5959
hi-doc = { workspace = true, optional = true }
6060
# Bigint
6161
num-bigint = { workspace = true, features = ["serde"], optional = true }
62-
derivative.workspace = true
6362
stacker = "0.1.15"

crates/jrsonnet-evaluator/src/function/parse.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
use std::mem::replace;
22

3-
use jrsonnet_gcmodule::Trace;
43
use jrsonnet_interner::IStr;
5-
use jrsonnet_parser::{LocExpr, ParamsDesc};
4+
use jrsonnet_parser::ParamsDesc;
65

76
use super::{arglike::ArgsLike, builtin::BuiltinParam};
87
use crate::{

crates/jrsonnet-evaluator/src/val.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ use std::{
88
rc::Rc,
99
};
1010

11-
use derivative::Derivative;
1211
use jrsonnet_gcmodule::{Cc, Trace};
1312
use jrsonnet_interner::IStr;
1413
pub use jrsonnet_macros::Thunk;
@@ -402,8 +401,7 @@ impl Ord for StrValue {
402401

403402
/// Represents jsonnet number
404403
/// Jsonnet numbers are finite f64, with NaNs disallowed
405-
#[derive(Trace, Clone, Copy, Derivative)]
406-
#[derivative(Debug = "transparent")]
404+
#[derive(Trace, Clone, Copy)]
407405
#[repr(transparent)]
408406
pub struct NumValue(f64);
409407
impl NumValue {
@@ -439,6 +437,11 @@ impl PartialOrd for NumValue {
439437
Some(self.cmp(other))
440438
}
441439
}
440+
impl Debug for NumValue {
441+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
442+
Debug::fmt(&self.0, f)
443+
}
444+
}
442445
impl Display for NumValue {
443446
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
444447
Display::fmt(&self.0, f)

0 commit comments

Comments
 (0)