From e5252720192064c8dfee6b869e8a5859d08e4a94 Mon Sep 17 00:00:00 2001 From: edef Date: Fri, 27 Oct 2023 12:31:12 +0000 Subject: refactor(tvix): turn nullary enum variants into unit variants Change-Id: Iad4f2cb4aa92b5bb29ead6050348a8cd3e7b8632 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9860 Reviewed-by: flokli Tested-by: BuildkiteCI --- tvix/store/src/proto/mod.rs | 4 ++-- tvix/store/src/proto/tests/pathinfo.rs | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'tvix/store/src/proto') diff --git a/tvix/store/src/proto/mod.rs b/tvix/store/src/proto/mod.rs index fe942ac2663e..232086c0f894 100644 --- a/tvix/store/src/proto/mod.rs +++ b/tvix/store/src/proto/mod.rs @@ -29,7 +29,7 @@ pub enum ValidatePathInfoError { /// No node present #[error("No node present")] - NoNodePresent(), + NoNodePresent, /// Node fails validation #[error("Invalid root node: {:?}", .0.to_string())] @@ -159,7 +159,7 @@ impl PathInfo { // Ensure there is a (root) node present, and it properly parses to a [store_path::StorePath]. let root_nix_path = match &self.node { None | Some(castorepb::Node { node: None }) => { - Err(ValidatePathInfoError::NoNodePresent())? + Err(ValidatePathInfoError::NoNodePresent)? } Some(castorepb::Node { node: Some(node) }) => { node.validate() diff --git a/tvix/store/src/proto/tests/pathinfo.rs b/tvix/store/src/proto/tests/pathinfo.rs index 392d5d8127b4..c296512f66cd 100644 --- a/tvix/store/src/proto/tests/pathinfo.rs +++ b/tvix/store/src/proto/tests/pathinfo.rs @@ -8,12 +8,12 @@ use tvix_castore::proto as castorepb; #[test_case( None, - Err(ValidatePathInfoError::NoNodePresent()) ; + Err(ValidatePathInfoError::NoNodePresent) ; "No node" )] #[test_case( Some(castorepb::Node { node: None }), - Err(ValidatePathInfoError::NoNodePresent()); + Err(ValidatePathInfoError::NoNodePresent); "No node 2" )] fn validate_no_node( @@ -54,7 +54,7 @@ fn validate_no_node( }, Err(ValidatePathInfoError::InvalidNodeName( "invalid".into(), - store_path::Error::InvalidLength() + store_path::Error::InvalidLength )); "invalid node name" )] @@ -99,7 +99,7 @@ fn validate_directory( }, Err(ValidatePathInfoError::InvalidNodeName( "invalid".into(), - store_path::Error::InvalidLength() + store_path::Error::InvalidLength )); "invalid node name" )] @@ -132,7 +132,7 @@ fn validate_file( }, Err(ValidatePathInfoError::InvalidNodeName( "invalid".into(), - store_path::Error::InvalidLength() + store_path::Error::InvalidLength )); "invalid node name" )] -- cgit 1.4.1