Ensure tests work correctly when no features enabled

This commit is contained in:
Tobie Morgan Hitchcock 2023-03-30 11:10:07 +01:00
parent 33cbe6528f
commit 86f768e996
2 changed files with 6 additions and 0 deletions

View file

@ -39,6 +39,7 @@ pub(super) enum Inner {
impl fmt::Display for Datastore {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
#![allow(unused_variables)]
match &self.inner {
#[cfg(feature = "kv-mem")]
Inner::Mem(_) => write!(f, "memory"),
@ -50,6 +51,8 @@ impl fmt::Display for Datastore {
Inner::TiKV(_) => write!(f, "tikv"),
#[cfg(feature = "kv-fdb")]
Inner::FDB(_) => write!(f, "fdb"),
#[allow(unreachable_patterns)]
_ => unreachable!(),
}
}
}

View file

@ -57,6 +57,7 @@ pub(super) enum Inner {
impl fmt::Display for Transaction {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
#![allow(unused_variables)]
match &self.inner {
#[cfg(feature = "kv-mem")]
Inner::Mem(_) => write!(f, "memory"),
@ -68,6 +69,8 @@ impl fmt::Display for Transaction {
Inner::TiKV(_) => write!(f, "tikv"),
#[cfg(feature = "kv-fdb")]
Inner::FDB(_) => write!(f, "fdb"),
#[allow(unreachable_patterns)]
_ => unreachable!(),
}
}
}