From 48efb5268d214ec82158d6f3fa44f290758690ed Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Wed, 17 May 2023 16:06:25 +0200 Subject: [PATCH] datastore: return error instead of unreachable very unexpected and unreachable is probably fine here, but it's not really winning us anything, so avoid the panic-potential and just bail out. Signed-off-by: Thomas Lamprecht --- pbs-datastore/src/catalog.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pbs-datastore/src/catalog.rs b/pbs-datastore/src/catalog.rs index 949e25b8..2b75a804 100644 --- a/pbs-datastore/src/catalog.rs +++ b/pbs-datastore/src/catalog.rs @@ -518,7 +518,7 @@ impl CatalogReader { attr: DirEntryAttribute::Directory { start }, .. } => self.dump_dir(std::path::Path::new("./"), start), - _ => unreachable!(), + _ => bail!("unexpected root entry type, not a directory!"), } }