From 526295a71d205f68a3000884981b9312fc400469 Mon Sep 17 00:00:00 2001 From: sterni Date: Sat, 13 Jan 2024 19:21:34 +0100 Subject: chore(3p/sources): Bump channels & overlays - Adjust to ecl 23.9.9 release - Regenerate go protos after protoc-gen-go update - Drop dhall fork which hasn't kept up with 1.42.* - Address new clippy warnings: - Variant naming of Error::ValidationError - Simplify .try_into().unwrap() - Drop unnecessary identity function - Test module must be last in file - Drop unused `pub use` - Update agenix to 0.15.0. Current master has a installCheckPhase that doesn't work with C++ Nix 2.3.*: https://github.com/ryantm/agenix/commit/a23aa271bec82d3e962bafb994595c1c4a62b133#commitcomment-137185861 Change-Id: Ic29eef20d6fd1362ce1031364a5ca6b4edf195bd Reviewed-on: https://cl.tvl.fyi/c/depot/+/10615 Reviewed-by: aspen Tested-by: BuildkiteCI Autosubmit: sterni --- tvix/nix-compat/src/nar/wire/tag.rs | 60 ++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 30 deletions(-) (limited to 'tvix/nix-compat/src/nar') diff --git a/tvix/nix-compat/src/nar/wire/tag.rs b/tvix/nix-compat/src/nar/wire/tag.rs index 55ce4b4a2a..55b93f9985 100644 --- a/tvix/nix-compat/src/nar/wire/tag.rs +++ b/tvix/nix-compat/src/nar/wire/tag.rs @@ -91,36 +91,6 @@ macro_rules! make { }; } -pub(crate) use make; - -#[cfg(test)] -mod test { - use super::super::tag::{self, Tag}; - - const TOK_A: [u8; 3] = [0xed, 0xef, 0x1c]; - const TOK_B: [u8; 3] = [0xed, 0xf0, 0x1c]; - - const OFFSET: usize = 1; - - make! { - enum Token[OFFSET] { - A = TOK_A, - B = TOK_B, - } - } - - #[test] - fn example() { - assert_eq!(Token::from_u8(0xed), None); - - let tag = Token::from_u8(0xef).unwrap(); - assert_eq!(tag.as_bytes(), &TOK_A[..]); - - let tag = Token::from_u8(0xf0).unwrap(); - assert_eq!(tag.as_bytes(), &TOK_B[..]); - } -} - // The following functions are written somewhat unusually, // since they're const functions that cannot use iterators. @@ -163,3 +133,33 @@ pub const fn min_of(mut xs: &[usize]) -> usize { pub const fn buf_of(xs: &[usize]) -> usize { max_of(&[min_of(xs), max_of(xs) - min_of(xs)]) } + +pub(crate) use make; + +#[cfg(test)] +mod test { + use super::super::tag::{self, Tag}; + + const TOK_A: [u8; 3] = [0xed, 0xef, 0x1c]; + const TOK_B: [u8; 3] = [0xed, 0xf0, 0x1c]; + + const OFFSET: usize = 1; + + make! { + enum Token[OFFSET] { + A = TOK_A, + B = TOK_B, + } + } + + #[test] + fn example() { + assert_eq!(Token::from_u8(0xed), None); + + let tag = Token::from_u8(0xef).unwrap(); + assert_eq!(tag.as_bytes(), &TOK_A[..]); + + let tag = Token::from_u8(0xf0).unwrap(); + assert_eq!(tag.as_bytes(), &TOK_B[..]); + } +} -- cgit 1.4.1