diff --git a/client-sdk/src/ring_reader.rs b/client-sdk/src/ring_reader.rs index ff9713f..bce644b 100644 --- a/client-sdk/src/ring_reader.rs +++ b/client-sdk/src/ring_reader.rs @@ -494,6 +494,12 @@ pub struct EntryReader { impl EntryReader { pub fn open(database_dir: &mut PathBuf) -> Result { + let direct_dir = { + let file = PathView::new(database_dir, "direct"); + openat(CWD, &*file, OFlags::DIRECTORY | OFlags::PATH, Mode::empty()) + .map_io_err(|| format!("Failed to open directory: {file:?}")) + }?; + let buckets = { let mut buckets = PathView::new(database_dir, "buckets"); let (buckets, lengths) = open_buckets(|name| { @@ -512,12 +518,6 @@ impl EntryReader { maps.into_inner().unwrap() }; - let direct_dir = { - let file = PathView::new(database_dir, "direct"); - openat(CWD, &*file, OFlags::DIRECTORY | OFlags::PATH, Mode::empty()) - .map_io_err(|| format!("Failed to open directory: {file:?}")) - }?; - Ok(Self { buckets, direct: direct_dir,