mirror of
https://github.com/hinto-janai/cuprate.git
synced 2024-12-22 19:49:33 +00:00
database: use Infallible
for non-dup secondary keys (#60)
This commit is contained in:
parent
331d4d3e7f
commit
ce3c8c5870
1 changed files with 6 additions and 1 deletions
|
@ -69,7 +69,12 @@ macro_rules! impl_key {
|
||||||
impl Key for $t {
|
impl Key for $t {
|
||||||
const DUPLICATE: bool = false;
|
const DUPLICATE: bool = false;
|
||||||
type Primary = $t;
|
type Primary = $t;
|
||||||
type Secondary = $t;
|
// This 0 variant enum is unconstructable,
|
||||||
|
// and "has the same role as the ! “never” type":
|
||||||
|
// <https://doc.rust-lang.org/std/convert/enum.Infallible.html#future-compatibility>.
|
||||||
|
//
|
||||||
|
// FIXME: Use the `!` type when stable.
|
||||||
|
type Secondary = std::convert::Infallible;
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn primary(self) -> Self::Primary {
|
fn primary(self) -> Self::Primary {
|
||||||
|
|
Loading…
Reference in a new issue