From b3b1f649d613c97a196528b1210dd5b914995c14 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 5 Nov 2023 20:31:46 +0300 Subject: chore(tvix): fix trivial clippy lints Relates to b/321. Change-Id: I37284f89b186e469eb432e2bbedb37aa125a6ad4 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9961 Tested-by: BuildkiteCI Reviewed-by: flokli Autosubmit: tazjin --- tvix/nix-compat/src/derivation/parser.rs | 4 ++-- tvix/nix-compat/src/derivation/tests/mod.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'tvix/nix-compat') diff --git a/tvix/nix-compat/src/derivation/parser.rs b/tvix/nix-compat/src/derivation/parser.rs index 5d7b109f80de..3b79f7bea3fc 100644 --- a/tvix/nix-compat/src/derivation/parser.rs +++ b/tvix/nix-compat/src/derivation/parser.rs @@ -19,7 +19,7 @@ use crate::{aterm, nixhash}; #[derive(Debug, thiserror::Error)] pub enum Error { #[error("parsing error: {0}")] - ParseError(NomError), + Parser(NomError), #[error("premature EOF")] Incomplete, #[error("validation error: {0}")] @@ -38,7 +38,7 @@ pub(crate) fn parse(i: &[u8]) -> Result> { Ok(derivation) } Err(nom::Err::Incomplete(_)) => Err(Error::Incomplete), - Err(nom::Err::Error(e) | nom::Err::Failure(e)) => Err(Error::ParseError(e)), + Err(nom::Err::Error(e) | nom::Err::Failure(e)) => Err(Error::Parser(e)), } } diff --git a/tvix/nix-compat/src/derivation/tests/mod.rs b/tvix/nix-compat/src/derivation/tests/mod.rs index b969625d9760..a14ca0938837 100644 --- a/tvix/nix-compat/src/derivation/tests/mod.rs +++ b/tvix/nix-compat/src/derivation/tests/mod.rs @@ -1,7 +1,7 @@ use super::parse_error::ErrorKind; use crate::derivation::output::Output; use crate::derivation::parse_error::NomError; -use crate::derivation::parser::Error::ParseError; +use crate::derivation::parser::Error; use crate::derivation::Derivation; use crate::store_path::StorePath; use bstr::{BStr, BString}; @@ -116,7 +116,7 @@ fn from_aterm_bytes_duplicate_map_key() { let err = Derivation::from_aterm_bytes(&buf).expect_err("must fail"); match err { - ParseError(NomError { input: _, code }) => { + Error::Parser(NomError { input: _, code }) => { assert_eq!(code, ErrorKind::DuplicateMapKey("name".to_string())); } _ => { -- cgit 1.4.1