git.delta.rocks / jrsonnet / refs/commits / 4e0dbf427e61

difftreelog

style update rustfmt

Yaroslav Bolyukin2023-07-26parent: #f883d5e.patch.diff
in: master

9 files changed

modifiedcmds/jrsonnet/src/main.rsdiffbeforeafterboth
--- a/cmds/jrsonnet/src/main.rs
+++ b/cmds/jrsonnet/src/main.rs
@@ -208,7 +208,10 @@
 			create_dir_all(dir)?;
 		}
 		let Val::Obj(obj) = val else {
-			throw!("value should be object for --multi manifest, got {}", val.value_type())
+			throw!(
+				"value should be object for --multi manifest, got {}",
+				val.value_type()
+			)
 		};
 		for (field, data) in obj.iter(
 			#[cfg(feature = "exp-preserve-order")]
modifiedcrates/jrsonnet-evaluator/src/arr/spec.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/arr/spec.rs
+++ b/crates/jrsonnet-evaluator/src/arr/spec.rs
@@ -178,7 +178,9 @@
 			ArrayThunk::Waiting(..) => {}
 		};
 
-		let ArrayThunk::Waiting(expr) = replace(&mut self.0.cached.borrow_mut()[index], ArrayThunk::Pending) else {
+		let ArrayThunk::Waiting(expr) =
+			replace(&mut self.0.cached.borrow_mut()[index], ArrayThunk::Pending)
+		else {
 			unreachable!()
 		};
 
@@ -489,7 +491,9 @@
 			ArrayThunk::Waiting(..) => {}
 		};
 
-		let ArrayThunk::Waiting(_) = replace(&mut self.0.cached.borrow_mut()[index], ArrayThunk::Pending) else {
+		let ArrayThunk::Waiting(_) =
+			replace(&mut self.0.cached.borrow_mut()[index], ArrayThunk::Pending)
+		else {
 			unreachable!()
 		};
 
modifiedcrates/jrsonnet-evaluator/src/manifest.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/manifest.rs
+++ b/crates/jrsonnet-evaluator/src/manifest.rs
@@ -276,7 +276,10 @@
 impl ManifestFormat for StringFormat {
 	fn manifest_buf(&self, val: Val, out: &mut String) -> Result<()> {
 		let Val::Str(s) = val else {
-			throw!("output should be string for string manifest format, got {}", val.value_type())
+			throw!(
+				"output should be string for string manifest format, got {}",
+				val.value_type()
+			)
 		};
 		write!(out, "{s}").unwrap();
 		Ok(())
@@ -290,7 +293,10 @@
 impl<I: ManifestFormat> ManifestFormat for YamlStreamFormat<I> {
 	fn manifest_buf(&self, val: Val, out: &mut String) -> Result<()> {
 		let Val::Arr(arr) = val else {
-			throw!("output should be array for yaml stream format, got {}", val.value_type())
+			throw!(
+				"output should be array for yaml stream format, got {}",
+				val.value_type()
+			)
 		};
 		if !arr.is_empty() {
 			for v in arr.iter() {
modifiedcrates/jrsonnet-evaluator/src/val.rsdiffbeforeafterboth
--- a/crates/jrsonnet-evaluator/src/val.rs
+++ b/crates/jrsonnet-evaluator/src/val.rs
@@ -72,7 +72,8 @@
 			ThunkInner::Pending => return Err(InfiniteRecursionDetected.into()),
 			ThunkInner::Waiting(..) => (),
 		};
-		let ThunkInner::Waiting(value) = replace(&mut *self.0.borrow_mut(), ThunkInner::Pending) else {
+		let ThunkInner::Waiting(value) = replace(&mut *self.0.borrow_mut(), ThunkInner::Pending)
+		else {
 			unreachable!();
 		};
 		let new_value = match value.0.get() {
modifiedcrates/jrsonnet-macros/src/lib.rsdiffbeforeafterboth
--- a/crates/jrsonnet-macros/src/lib.rs
+++ b/crates/jrsonnet-macros/src/lib.rs
@@ -51,7 +51,7 @@
 
 fn extract_type_from_option(ty: &Type) -> Result<Option<&Type>> {
 	let Some(args) = type_is_path(ty, "Option") else {
-		return Ok(None)
+		return Ok(None);
 	};
 	// It should have only on angle-bracketed param ("<String>"):
 	let PathArguments::AngleBracketed(params) = args else {
@@ -63,7 +63,7 @@
 		return Err(Error::new(
 			generic_arg.span(),
 			"option generic should be a type",
-		))
+		));
 	};
 	Ok(Some(ty))
 }
@@ -210,7 +210,7 @@
 		return Err(Error::new(
 			fun.sig.span(),
 			"builtin should return something",
-		))
+		));
 	};
 
 	let name = fun.sig.ident.to_string();
modifiedcrates/jrsonnet-parser/src/lib.rsdiffbeforeafterboth
--- a/crates/jrsonnet-parser/src/lib.rs
+++ b/crates/jrsonnet-parser/src/lib.rs
@@ -630,7 +630,7 @@
 					el!(
 						Apply(
 							el!(
-								Index{
+								Index {
 									indexable: el!(Var("std".into()), 1, 4),
 									index: el!(Str("deepJoin".into()), 5, 13),
 									#[cfg(feature = "exp-null-coaelse")]
modifiedcrates/jrsonnet-parser/src/source.rsdiffbeforeafterboth
--- a/crates/jrsonnet-parser/src/source.rs
+++ b/crates/jrsonnet-parser/src/source.rs
@@ -33,7 +33,7 @@
 		}
 		fn dyn_eq(&self, other: &dyn $T) -> bool {
 			let Some(other) = other.as_any().downcast_ref::<Self>() else {
-				return false
+				return false;
 			};
 			let this = <Self as $T>::as_any(self)
 				.downcast_ref::<Self>()
modifiedflake.lockdiffbeforeafterboth
before · flake.lock
5 packageslockfile v7
modifiedflake.nixdiffbeforeafterboth
--- a/flake.nix
+++ b/flake.nix
@@ -16,7 +16,7 @@
           inherit system;
           overlays = [ rust-overlay.overlays.default ];
         };
-        rust = ((pkgs.rustChannelOf { date = "2023-06-26"; channel = "nightly"; }).default.override {
+        rust = ((pkgs.rustChannelOf { date = "2023-07-23"; channel = "nightly"; }).default.override {
           extensions = [ "rust-src" "miri" "rust-analyzer" ];
         });
       in