From 4017039595fc85c02c8c313b73073220954b9f5a Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Sun, 20 Aug 2023 23:17:38 +0200 Subject: refactor(tvix/nix-compat): cargo clippy Change-Id: I1c1608a6e75e451940fe1c61dc5ace5f0e7d7752 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9111 Reviewed-by: raitobezarius Tested-by: BuildkiteCI --- tvix/nix-compat/src/derivation/output.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'tvix/nix-compat') diff --git a/tvix/nix-compat/src/derivation/output.rs b/tvix/nix-compat/src/derivation/output.rs index ece414a5091c..982d8222e90e 100644 --- a/tvix/nix-compat/src/derivation/output.rs +++ b/tvix/nix-compat/src/derivation/output.rs @@ -22,11 +22,11 @@ impl<'de> Deserialize<'de> for Output { path: fields .get("path") .ok_or(serde::de::Error::missing_field( - &"`path` is missing but required for outputs", + "`path` is missing but required for outputs", ))? .as_str() .ok_or(serde::de::Error::invalid_type( - serde::de::Unexpected::Other(&"certainly not a string"), + serde::de::Unexpected::Other("certainly not a string"), &"a string", ))? .to_owned(), @@ -67,7 +67,7 @@ fn deserialize_valid_input_addressed_output() { { "path": "/nix/store/blablabla" }"#; - let output: Output = serde_json::from_str(&json_bytes).expect("must parse"); + let output: Output = serde_json::from_str(json_bytes).expect("must parse"); assert!(!output.is_fixed()); } @@ -82,7 +82,7 @@ fn deserialize_valid_fixed_output() { "hash": "08813cbee9903c62be4c5027726a418a300da4500b2d369d3af9286f4815ceba", "hashAlgo": "r:sha256" }"#; - let output: Output = serde_json::from_str(&json_bytes).expect("must parse"); + let output: Output = serde_json::from_str(json_bytes).expect("must parse"); assert!(output.is_fixed()); } @@ -97,7 +97,7 @@ fn deserialize_with_error_invalid_hash_encoding_fixed_output() { "hash": "IAMNOTVALIDNIXBASE32", "hashAlgo": "r:sha256" }"#; - let output: Result = serde_json::from_str(&json_bytes); + let output: Result = serde_json::from_str(json_bytes); assert!(output.is_err()); } @@ -112,7 +112,7 @@ fn deserialize_with_error_invalid_hash_algo_fixed_output() { "hash": "08813cbee9903c62be4c5027726a418a300da4500b2d369d3af9286f4815ceba", "hashAlgo": "r:sha1024" }"#; - let output: Result = serde_json::from_str(&json_bytes); + let output: Result = serde_json::from_str(json_bytes); assert!(output.is_err()); } @@ -126,7 +126,7 @@ fn deserialize_with_error_missing_hash_algo_fixed_output() { "path": "/nix/store/blablablabla", "hash": "08813cbee9903c62be4c5027726a418a300da4500b2d369d3af9286f4815ceba", }"#; - let output: Result = serde_json::from_str(&json_bytes); + let output: Result = serde_json::from_str(json_bytes); assert!(output.is_err()); } @@ -140,7 +140,7 @@ fn deserialize_with_error_missing_hash_fixed_output() { "path": "/nix/store/blablablabla", "hashAlgo": "r:sha1024" }"#; - let output: Result = serde_json::from_str(&json_bytes); + let output: Result = serde_json::from_str(json_bytes); assert!(output.is_err()); } -- cgit 1.4.1