git.delta.rocks / jrsonnet / refs/commits / dbbcbc4becf1

difftreelog

style fix clippy warnings

Yaroslav Bolyukin2024-01-16parent: #4a33c1a.patch.diff
in: master

17 files changed

modifiedcrates/jrsonnet-evaluator/src/arr/spec.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/arr/spec.rs
+++ b/crates/jrsonnet-evaluator/src/arr/spec.rs
@@ -372,7 +372,7 @@
 	pub fn new_inclusive(start: i32, end: i32) -> Self {
 		Self { start, end }
 	}
-	fn range(&self) -> impl Iterator<Item = i32> + ExactSizeIterator + DoubleEndedIterator {
+	fn range(&self) -> impl ExactSizeIterator<Item = i32> + DoubleEndedIterator {
 		WithExactSize(
 			self.start..=self.end,
 			(self.end as usize)
@@ -461,7 +461,7 @@
 			ArrayThunk::Waiting(..) => {}
 		};
 
-		let ArrayThunk::Waiting(_) =
+		let ArrayThunk::Waiting(()) =
 			replace(&mut self.cached.borrow_mut()[index], ArrayThunk::Pending)
 		else {
 			unreachable!()
@@ -508,7 +508,7 @@
 		match &self.cached.borrow()[index] {
 			ArrayThunk::Computed(c) => return Some(Thunk::evaluated(c.clone())),
 			ArrayThunk::Errored(e) => return Some(Thunk::errored(e.clone())),
-			ArrayThunk::Waiting(_) | ArrayThunk::Pending => {}
+			ArrayThunk::Waiting(()) | ArrayThunk::Pending => {}
 		};
 
 		Some(Thunk::new(ArrayElement {
@@ -597,9 +597,7 @@
 	}
 
 	fn get_lazy(&self, index: usize) -> Option<Thunk<Val>> {
-		let Some(key) = self.keys.get(index) else {
-			return None;
-		};
+		let key = self.keys.get(index)?;
 		Some(self.obj.get_lazy_or_bail(key.clone()))
 	}
 
@@ -649,9 +647,7 @@
 	}
 
 	fn get_lazy(&self, index: usize) -> Option<Thunk<Val>> {
-		let Some(key) = self.keys.get(index) else {
-			return None;
-		};
+		let key = self.keys.get(index)?;
 		// Nothing can fail in the key part, yet value is still
 		// lazy-evaluated
 		Some(Thunk::evaluated(
modifiedcrates/jrsonnet-evaluator/src/evaluate/mod.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/evaluate/mod.rs
+++ b/crates/jrsonnet-evaluator/src/evaluate/mod.rs
@@ -89,7 +89,7 @@
 	specs: &[CompSpec],
 	callback: &mut impl FnMut(Context) -> Result<()>,
 ) -> Result<()> {
-	match specs.get(0) {
+	match specs.first() {
 		None => callback(ctx)?,
 		Some(CompSpec::IfSpec(IfSpecData(cond))) => {
 			if bool::from_untyped(evaluate(ctx.clone(), cond)?)? {
modifiedcrates/jrsonnet-evaluator/src/function/builtin.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/function/builtin.rs
+++ b/crates/jrsonnet-evaluator/src/function/builtin.rs
@@ -6,8 +6,8 @@
 use super::{arglike::ArgsLike, parse::parse_builtin_call, CallLocation};
 use crate::{gc::TraceBox, tb, Context, Result, Val};
 
-/// Can't have str | IStr, because constant BuiltinParam causes
-/// E0492: constant functions cannot refer to interior mutable data
+/// Can't have `str` | `IStr`, because constant `BuiltinParam` causes
+/// `E0492: constant functions cannot refer to interior mutable data`
 #[derive(Clone, Trace)]
 pub struct ParamName(Option<Cow<'static, str>>);
 impl ParamName {
@@ -27,10 +27,9 @@
 }
 impl PartialEq<IStr> for ParamName {
 	fn eq(&self, other: &IStr) -> bool {
-		match &self.0 {
-			Some(s) => s.as_bytes() == other.as_bytes(),
-			None => false,
-		}
+		self.0
+			.as_ref()
+			.map_or(false, |s| s.as_bytes() == other.as_bytes())
 	}
 }
 
@@ -87,7 +86,7 @@
 			params: params
 				.into_iter()
 				.map(|n| BuiltinParam {
-					name: ParamName::new_dynamic(n.to_string()),
+					name: ParamName::new_dynamic(n),
 					has_default: false,
 				})
 				.collect(),
modifiedcrates/jrsonnet-evaluator/src/integrations/serde.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/integrations/serde.rs
+++ b/crates/jrsonnet-evaluator/src/integrations/serde.rs
@@ -159,11 +159,11 @@
 			Val::Null => serializer.serialize_none(),
 			Val::Str(s) => serializer.serialize_str(&s.clone().into_flat()),
 			Val::Num(n) => {
-				if n.fract() != 0.0 {
-					serializer.serialize_f64(*n)
-				} else {
+				if n.fract() == 0.0 {
 					let n = *n as i64;
 					serializer.serialize_i64(n)
+				} else {
+					serializer.serialize_f64(*n)
 				}
 			}
 			#[cfg(feature = "exp-bigint")]
modifiedcrates/jrsonnet-evaluator/src/lib.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/lib.rs
+++ b/crates/jrsonnet-evaluator/src/lib.rs
@@ -41,10 +41,12 @@
 	clippy::missing_const_for_fn,
 	// too many false-positives with .expect() calls
 	clippy::missing_panics_doc,
-    // false positive for IStr type. There is an configuration option for
-    // such cases, but it doesn't work:
-    // https://github.com/rust-lang/rust-clippy/issues/9801
-    clippy::mutable_key_type,
+	// false positive for IStr type. There is an configuration option for
+	// such cases, but it doesn't work:
+	// https://github.com/rust-lang/rust-clippy/issues/9801
+	clippy::mutable_key_type,
+	// false positives
+	clippy::redundant_pub_crate,
 )]
 
 // For jrsonnet-macros
modifiedcrates/jrsonnet-evaluator/src/manifest.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/manifest.rs
+++ b/crates/jrsonnet-evaluator/src/manifest.rs
@@ -175,6 +175,8 @@
 	manifest_json_ex_buf(val, &mut out, &mut String::new(), options)?;
 	Ok(out)
 }
+
+#[allow(clippy::too_many_lines)]
 fn manifest_json_ex_buf(
 	val: &Val,
 	buf: &mut String,
modifiedcrates/jrsonnet-evaluator/src/obj.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/obj.rs
+++ b/crates/jrsonnet-evaluator/src/obj.rs
@@ -171,7 +171,7 @@
 			// .field("assertions_ran", &self.assertions_ran)
 			.field("this_entries", &self.this_entries)
 			// .field("value_cache", &self.value_cache)
-			.finish()
+			.finish_non_exhaustive()
 	}
 }
 
@@ -347,7 +347,7 @@
 		out.with_super(self);
 		let mut member = out.field(key);
 		if value.flags.add() {
-			member = member.add()
+			member = member.add();
 		}
 		if let Some(loc) = value.location {
 			member = member.with_location(loc);
@@ -395,7 +395,7 @@
 
 	pub fn get(&self, key: IStr) -> Result<Option<Val>> {
 		self.run_assertions()?;
-		self.get_for(key, self.0.this().unwrap_or(self.clone()))
+		self.get_for(key, self.0.this().unwrap_or_else(|| self.clone()))
 	}
 
 	pub fn get_for(&self, key: IStr, this: ObjValue) -> Result<Option<Val>> {
@@ -474,7 +474,7 @@
 			type Output = Val;
 
 			fn get(self: Box<Self>) -> Result<Self::Output> {
-				Ok(self.obj.get_or_bail(self.key)?)
+				self.obj.get_or_bail(self.key)
 			}
 		}
 
@@ -495,7 +495,7 @@
 			SuperDepth::default(),
 			&mut |depth, index, name, visibility| {
 				let new_sort_key = FieldSortKey::new(depth, index);
-				let entry = out.entry(name.clone());
+				let entry = out.entry(name);
 				let (visible, _) = entry.or_insert((true, new_sort_key));
 				match visibility {
 					Visibility::Normal => {}
@@ -634,7 +634,7 @@
 			SuperDepth::default(),
 			&mut |depth, index, name, visibility| {
 				let new_sort_key = FieldSortKey::new(depth, index);
-				let entry = out.entry(name.clone());
+				let entry = out.entry(name);
 				let (visible, _) = entry.or_insert((true, new_sort_key));
 				match visibility {
 					Visibility::Normal => {}
modifiedcrates/jrsonnet-evaluator/src/stdlib/format.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/stdlib/format.rs
+++ b/crates/jrsonnet-evaluator/src/stdlib/format.rs
@@ -248,7 +248,7 @@
 	let (cflags, str) = try_parse_cflags(str)?;
 	let (width, str) = try_parse_field_width(str)?;
 	let (precision, str) = try_parse_precision(str)?;
-	let (_, str) = try_parse_length_modifier(str)?;
+	let ((), str) = try_parse_length_modifier(str)?;
 	let (convtype, str) = parse_conversion_type(str)?;
 
 	Ok((
modifiedcrates/jrsonnet-evaluator/src/typed/conversions.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/typed/conversions.rs
+++ b/crates/jrsonnet-evaluator/src/typed/conversions.rs
@@ -449,25 +449,21 @@
 	}
 
 	fn from_untyped(value: Val) -> Result<Self> {
-		match &value {
-			Val::Arr(a) => {
-				if let Some(bytes) = a.as_any().downcast_ref::<BytesArray>() {
-					return Ok(bytes.0.as_slice().into());
-				};
-				<Self as Typed>::TYPE.check(&value)?;
-				// Any::downcast_ref::<ByteArray>(&a);
-				let mut out = Vec::with_capacity(a.len());
-				for e in a.iter() {
-					let r = e?;
-					out.push(u8::from_untyped(r)?);
-				}
-				Ok(out.as_slice().into())
-			}
-			_ => {
-				<Self as Typed>::TYPE.check(&value)?;
-				unreachable!()
-			}
+		let Val::Arr(a) = &value else {
+			<Self as Typed>::TYPE.check(&value)?;
+			unreachable!()
+		};
+		if let Some(bytes) = a.as_any().downcast_ref::<BytesArray>() {
+			return Ok(bytes.0.as_slice().into());
+		};
+		<Self as Typed>::TYPE.check(&value)?;
+		// Any::downcast_ref::<ByteArray>(&a);
+		let mut out = Vec::with_capacity(a.len());
+		for e in a.iter() {
+			let r = e?;
+			out.push(u8::from_untyped(r)?);
 		}
+		Ok(out.as_slice().into())
 	}
 }
 
modifiedcrates/jrsonnet-evaluator/src/typed/mod.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/typed/mod.rs
+++ b/crates/jrsonnet-evaluator/src/typed/mod.rs
@@ -90,7 +90,7 @@
 	item: impl Fn() -> Result<()>,
 ) -> Result<()> {
 	State::push_description(error_reason, || match item() {
-		Ok(_) => Ok(()),
+		Ok(()) => Ok(()),
 		Err(mut e) => {
 			if let ErrorKind::TypeError(e) = &mut e.error_mut() {
 				(e.1).0.push(path());
modifiedcrates/jrsonnet-evaluator/src/val.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/val.rs
+++ b/crates/jrsonnet-evaluator/src/val.rs
@@ -351,6 +351,8 @@
 	}
 }
 impl PartialEq for StrValue {
+	// False positive, into_flat returns not StrValue, but IStr, thus no infinite recursion here.
+	#[allow(clippy::unconditional_recursion)]
 	fn eq(&self, other: &Self) -> bool {
 		let a = self.clone().into_flat();
 		let b = other.clone().into_flat();
modifiedcrates/jrsonnet-interner/src/lib.rsdiffbeforeafterboth
--- a/crates/jrsonnet-interner/src/lib.rs
+++ b/crates/jrsonnet-interner/src/lib.rs
@@ -6,7 +6,7 @@
 #![warn(clippy::pedantic, clippy::nursery)]
 #![allow(clippy::missing_const_for_fn)]
 use std::{
-	borrow::{Borrow, Cow},
+	borrow::Cow,
 	cell::RefCell,
 	fmt::{self, Display},
 	hash::{BuildHasherDefault, Hash, Hasher},
@@ -14,7 +14,7 @@
 	str,
 };
 
-use hashbrown::HashMap;
+use hashbrown::{hash_map::RawEntryMut, HashMap};
 use jrsonnet_gcmodule::Trace;
 use rustc_hash::FxHasher;
 
@@ -57,17 +57,6 @@
 	}
 }
 
-impl Borrow<str> for IStr {
-	fn borrow(&self) -> &str {
-		self.as_str()
-	}
-}
-impl Borrow<[u8]> for IStr {
-	fn borrow(&self) -> &[u8] {
-		self.as_bytes()
-	}
-}
-
 impl PartialEq for IStr {
 	fn eq(&self, other: &Self) -> bool {
 		// all IStr should be inlined into same pool
@@ -142,12 +131,6 @@
 	type Target = [u8];
 
 	fn deref(&self) -> &Self::Target {
-		self.0.as_slice()
-	}
-}
-
-impl Borrow<[u8]> for IBytes {
-	fn borrow(&self) -> &[u8] {
 		self.0.as_slice()
 	}
 }
@@ -285,9 +268,9 @@
 		let mut pool = pool.borrow_mut();
 		let entry = pool.raw_entry_mut().from_key(bytes);
 		match entry {
-			hashbrown::hash_map::RawEntryMut::Occupied(i) => IBytes(i.get_key_value().0.clone()),
-			hashbrown::hash_map::RawEntryMut::Vacant(e) => {
-				let (k, _) = e.insert(Inner::new_bytes(bytes), ());
+			RawEntryMut::Occupied(i) => IBytes(i.get_key_value().0.clone()),
+			RawEntryMut::Vacant(e) => {
+				let (k, ()) = e.insert(Inner::new_bytes(bytes), ());
 				IBytes(k.clone())
 			}
 		}
modifiedcrates/jrsonnet-macros/src/lib.rsdiffbeforeafterboth
--- a/crates/jrsonnet-macros/src/lib.rs
+++ b/crates/jrsonnet-macros/src/lib.rs
@@ -374,6 +374,7 @@
 				fn params(&self) -> &[BuiltinParam] {
 					PARAMS
 				}
+				#[allow(unused_variable)]
 				fn call(&self, ctx: Context, location: CallLocation, args: &dyn ArgsLike) -> Result<Val> {
 					let parsed = parse_builtin_call(ctx.clone(), &PARAMS, args, false)?;
 
modifiedcrates/jrsonnet-stdlib/src/encoding.rsdiffbeforeafterboth
--- a/crates/jrsonnet-stdlib/src/encoding.rs
+++ b/crates/jrsonnet-stdlib/src/encoding.rs
@@ -39,5 +39,5 @@
 	let bytes = STANDARD
 		.decode(str.as_bytes())
 		.map_err(|e| runtime_error!("invalid base64: {e}"))?;
-	Ok(String::from_utf8(bytes).map_err(|_| runtime_error!("bad utf8"))?)
+	String::from_utf8(bytes).map_err(|_| runtime_error!("bad utf8"))
 }
modifiedcrates/jrsonnet-stdlib/src/misc.rsdiffbeforeafterboth
--- a/crates/jrsonnet-stdlib/src/misc.rs
+++ b/crates/jrsonnet-stdlib/src/misc.rs
@@ -47,7 +47,7 @@
 		.ext_natives
 		.get(&x)
 		.cloned()
-		.map_or(Val::Null, |v| Val::Func(v))
+		.map_or(Val::Null, Val::Func)
 }
 
 #[builtin(fields(
modifiedflake.lockdiffbeforeafterboth
--- a/flake.lock
+++ b/flake.lock
@@ -5,11 +5,11 @@
         "systems": "systems"
       },
       "locked": {
-        "lastModified": 1694529238,
-        "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
+        "lastModified": 1705309234,
+        "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
         "owner": "numtide",
         "repo": "flake-utils",
-        "rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
+        "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
         "type": "github"
       },
       "original": {
@@ -20,11 +20,11 @@
     },
     "nixpkgs": {
       "locked": {
-        "lastModified": 1701376520,
-        "narHash": "sha256-U3iGiOZqgu7wvVzgfoQzGGFMqNsDj/q/6zPIjCy7ajg=",
+        "lastModified": 1705391267,
+        "narHash": "sha256-gGVm9QudiRtYTX8PN9cTTy7uuJcL4I2lRMoPx496kXk=",
         "owner": "nixos",
         "repo": "nixpkgs",
-        "rev": "c74cc3c3db2ed5e68895953d75c397797d499133",
+        "rev": "41a9a7f170c740acb24f3390323877d11c69d5ee",
         "type": "github"
       },
       "original": {
@@ -50,11 +50,11 @@
         ]
       },
       "locked": {
-        "lastModified": 1701310566,
-        "narHash": "sha256-CL9J3xUR2Ejni4LysrEGX0IdO+Y4BXCiH/By0lmF3eQ=",
+        "lastModified": 1705371439,
+        "narHash": "sha256-P1kulUXpYWkcrjiX3sV4j8ACJZh9XXSaaD+jDLBDLKo=",
         "owner": "oxalica",
         "repo": "rust-overlay",
-        "rev": "6d3c6e185198b8bf7ad639f22404a75aa9a09bff",
+        "rev": "b21f3c0d5bf0f0179f5f0140e8e0cd099618bd04",
         "type": "github"
       },
       "original": {
modifiedflake.nixdiffbeforeafterboth
before · flake.nix
1{2  description = "Jrsonnet";3  inputs = {4    nixpkgs.url = "github:nixos/nixpkgs";5    flake-utils.url = "github:numtide/flake-utils";6    rust-overlay = {7      url = "github:oxalica/rust-overlay";8      inputs.nixpkgs.follows = "nixpkgs";9      inputs.flake-utils.follows = "flake-utils";10    };11  };12  outputs = {13    nixpkgs,14    flake-utils,15    rust-overlay,16    ...17  }:18    flake-utils.lib.eachSystem (with flake-utils.lib.system; [x86_64-linux x86_64-windows]) (19      system: let20        pkgs = import nixpkgs {21          inherit system;22          overlays = [rust-overlay.overlays.default];23          config.allowUnsupportedSystem = true;24        };25        lib = pkgs.lib;26        rust =27          (pkgs.rustChannelOf {28            date = "2023-10-28";29            channel = "nightly";30          })31          .default32          .override {33            extensions = ["rust-src" "miri" "rust-analyzer" "clippy"];34          };35      in rec {36        packages = rec {37          go-jsonnet = pkgs.callPackage ./nix/go-jsonnet.nix {};38          sjsonnet = pkgs.callPackage ./nix/sjsonnet.nix {};39          jsonnet = pkgs.callPackage ./nix/jsonnet.nix {};40          # I didn't managed to build it, and nixpkgs version is marked as broken41          # haskell-jsonnet = pkgs.callPackage ./nix/haskell-jsonnet.nix { };42          jrsonnet = pkgs.callPackage ./nix/jrsonnet.nix {43            rustPlatform = pkgs.makeRustPlatform {44              rustc = rust;45              cargo = rust;46            };47          };48          jrsonnet-nightly = pkgs.callPackage ./nix/jrsonnet.nix {49            rustPlatform = pkgs.makeRustPlatform {50              rustc = rust;51              cargo = rust;52            };53            withNightlyFeatures = true;54          };55          jrsonnet-release = pkgs.callPackage ./nix/jrsonnet-release.nix {56            rustPlatform = pkgs.makeRustPlatform {57              rustc = rust;58              cargo = rust;59            };60          };6162          benchmarks = pkgs.callPackage ./nix/benchmarks.nix {63            inherit go-jsonnet sjsonnet jsonnet;64            jrsonnetVariants = [65              {66                drv = jrsonnet;67                name = "";68              }69            ];70          };71          benchmarks-quick = pkgs.callPackage ./nix/benchmarks.nix {72            inherit go-jsonnet sjsonnet jsonnet;73            quick = true;74            jrsonnetVariants = [75              {76                drv = jrsonnet;77                name = "";78              }79            ];80          };81          benchmarks-against-release = pkgs.callPackage ./nix/benchmarks.nix {82            inherit go-jsonnet sjsonnet jsonnet;83            jrsonnetVariants = [84              {85                drv = jrsonnet;86                name = "current";87              }88              {89                drv = jrsonnet-nightly;90                name = "current-nightly";91              }92              {93                drv = jrsonnet-release;94                name = "release";95              }96            ];97          };98          benchmarks-quick-against-release = pkgs.callPackage ./nix/benchmarks.nix {99            inherit go-jsonnet sjsonnet jsonnet;100            quick = true;101            jrsonnetVariants = [102              {103                drv = jrsonnet;104                name = "current";105              }106              {107                drv = jrsonnet-nightly;108                name = "current-nightly";109              }110              {111                drv = jrsonnet-release;112                name = "release";113              }114            ];115          };116        };117        packagesCross = lib.genAttrs ["mingwW64"] (crossSystem: let118          callPackage = pkgs.pkgsCross.${crossSystem}.callPackage;119        in {120          jrsonnet = callPackage ./nix/jrsonnet.nix {121            # rustPlatform = pkgs.makeRustPlatform {122            #   rustc = rust;123            #   cargo = rust;124            # };125          };126        });127        devShells.default = pkgs.mkShell {128          nativeBuildInputs = with pkgs; [129            alejandra130            rust131            cargo-edit132            cargo-asm133            cargo-outdated134            cargo-watch135            cargo-insta136            lld137            hyperfine138            graphviz139          ];140        };141      }142    );143}
after · flake.nix
1{2  description = "Jrsonnet";3  inputs = {4    nixpkgs.url = "github:nixos/nixpkgs";5    flake-utils.url = "github:numtide/flake-utils";6    rust-overlay = {7      url = "github:oxalica/rust-overlay";8      inputs.nixpkgs.follows = "nixpkgs";9      inputs.flake-utils.follows = "flake-utils";10    };11  };12  outputs = {13    nixpkgs,14    flake-utils,15    rust-overlay,16    ...17  }:18    flake-utils.lib.eachSystem (with flake-utils.lib.system; [x86_64-linux x86_64-windows]) (19      system: let20        pkgs = import nixpkgs {21          inherit system;22          overlays = [rust-overlay.overlays.default];23          config.allowUnsupportedSystem = true;24        };25        lib = pkgs.lib;26        rust =27          (pkgs.rustChannelOf {28            date = "2024-01-10";29            channel = "nightly";30          })31          .default32          .override {33            extensions = ["rust-src" "miri" "rust-analyzer" "clippy"];34          };35      in {36        packages = rec {37          go-jsonnet = pkgs.callPackage ./nix/go-jsonnet.nix {};38          sjsonnet = pkgs.callPackage ./nix/sjsonnet.nix {};39          jsonnet = pkgs.callPackage ./nix/jsonnet.nix {};40          # I didn't managed to build it, and nixpkgs version is marked as broken41          # haskell-jsonnet = pkgs.callPackage ./nix/haskell-jsonnet.nix { };42          jrsonnet = pkgs.callPackage ./nix/jrsonnet.nix {43            rustPlatform = pkgs.makeRustPlatform {44              rustc = rust;45              cargo = rust;46            };47          };48          jrsonnet-nightly = pkgs.callPackage ./nix/jrsonnet.nix {49            rustPlatform = pkgs.makeRustPlatform {50              rustc = rust;51              cargo = rust;52            };53            withNightlyFeatures = true;54          };55          jrsonnet-release = pkgs.callPackage ./nix/jrsonnet-release.nix {56            rustPlatform = pkgs.makeRustPlatform {57              rustc = rust;58              cargo = rust;59            };60          };6162          benchmarks = pkgs.callPackage ./nix/benchmarks.nix {63            inherit go-jsonnet sjsonnet jsonnet;64            jrsonnetVariants = [65              {66                drv = jrsonnet;67                name = "";68              }69            ];70          };71          benchmarks-quick = pkgs.callPackage ./nix/benchmarks.nix {72            inherit go-jsonnet sjsonnet jsonnet;73            quick = true;74            jrsonnetVariants = [75              {76                drv = jrsonnet;77                name = "";78              }79            ];80          };81          benchmarks-against-release = pkgs.callPackage ./nix/benchmarks.nix {82            inherit go-jsonnet sjsonnet jsonnet;83            jrsonnetVariants = [84              {85                drv = jrsonnet;86                name = "current";87              }88              {89                drv = jrsonnet-nightly;90                name = "current-nightly";91              }92              {93                drv = jrsonnet-release;94                name = "release";95              }96            ];97          };98          benchmarks-quick-against-release = pkgs.callPackage ./nix/benchmarks.nix {99            inherit go-jsonnet sjsonnet jsonnet;100            quick = true;101            jrsonnetVariants = [102              {103                drv = jrsonnet;104                name = "current";105              }106              {107                drv = jrsonnet-nightly;108                name = "current-nightly";109              }110              {111                drv = jrsonnet-release;112                name = "release";113              }114            ];115          };116        };117        packagesCross = lib.genAttrs ["mingwW64"] (crossSystem: let118          callPackage = pkgs.pkgsCross.${crossSystem}.callPackage;119        in {120          jrsonnet = callPackage ./nix/jrsonnet.nix {121            # rustPlatform = pkgs.makeRustPlatform {122            #   rustc = rust;123            #   cargo = rust;124            # };125          };126        });127        devShells.default = pkgs.mkShell {128          nativeBuildInputs = with pkgs; [129            alejandra130            rust131            cargo-edit132            cargo-asm133            cargo-outdated134            cargo-watch135            cargo-insta136            lld137            hyperfine138            graphviz139          ];140        };141      }142    );143}