From ce3c8c5870f294d37d8de539d4570f627b326448 Mon Sep 17 00:00:00 2001 From: hinto-janai Date: Tue, 13 Feb 2024 15:57:29 -0500 Subject: [PATCH] database: use `Infallible` for non-dup secondary keys (#60) --- database/src/key.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/database/src/key.rs b/database/src/key.rs index a346e749..c0fee09d 100644 --- a/database/src/key.rs +++ b/database/src/key.rs @@ -69,7 +69,12 @@ macro_rules! impl_key { impl Key for $t { const DUPLICATE: bool = false; type Primary = $t; - type Secondary = $t; + // This 0 variant enum is unconstructable, + // and "has the same role as the ! “never” type": + // . + // + // FIXME: Use the `!` type when stable. + type Secondary = std::convert::Infallible; #[inline(always)] fn primary(self) -> Self::Primary {