Skip to content

Commit

Permalink
refactor: drop derivative dependency
Browse files Browse the repository at this point in the history
Fixes: #179
  • Loading branch information
CertainLach committed Nov 24, 2024
1 parent a9a2382 commit 6baa18d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 38 deletions.
39 changes: 8 additions & 31 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ hashbrown = "0.14.5"
static_assertions = "1.1"
rustc-hash = "1.1"
num-bigint = "0.4.5"
derivative = "2.2.0"
strsim = "0.11.0"
proc-macro2 = "1.0"
quote = "1.0"
Expand Down
1 change: 0 additions & 1 deletion crates/jrsonnet-evaluator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,4 @@ annotate-snippets = { workspace = true, optional = true }
hi-doc = { workspace = true, optional = true }
# Bigint
num-bigint = { workspace = true, features = ["serde"], optional = true }
derivative.workspace = true
stacker = "0.1.15"
3 changes: 1 addition & 2 deletions crates/jrsonnet-evaluator/src/function/parse.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use std::mem::replace;

use jrsonnet_gcmodule::Trace;
use jrsonnet_interner::IStr;
use jrsonnet_parser::{LocExpr, ParamsDesc};
use jrsonnet_parser::ParamsDesc;

use super::{arglike::ArgsLike, builtin::BuiltinParam};
use crate::{
Expand Down
9 changes: 6 additions & 3 deletions crates/jrsonnet-evaluator/src/val.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use std::{
rc::Rc,
};

use derivative::Derivative;
use jrsonnet_gcmodule::{Cc, Trace};
use jrsonnet_interner::IStr;
pub use jrsonnet_macros::Thunk;
Expand Down Expand Up @@ -402,8 +401,7 @@ impl Ord for StrValue {

/// Represents jsonnet number
/// Jsonnet numbers are finite f64, with NaNs disallowed
#[derive(Trace, Clone, Copy, Derivative)]
#[derivative(Debug = "transparent")]
#[derive(Trace, Clone, Copy)]
#[repr(transparent)]
pub struct NumValue(f64);
impl NumValue {
Expand Down Expand Up @@ -439,6 +437,11 @@ impl PartialOrd for NumValue {
Some(self.cmp(other))
}
}
impl Debug for NumValue {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
Debug::fmt(&self.0, f)
}
}
impl Display for NumValue {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
Display::fmt(&self.0, f)
Expand Down

0 comments on commit 6baa18d

Please sign in to comment.