Replace Index::new_with_creation_dates(...) with Index::new(...)

This commit is contained in:
amab8901 2022-12-16 08:20:13 +01:00
parent 5a0a0468df
commit 4e175ae882

View File

@ -71,10 +71,13 @@ impl IndexMapper {
options.map_size(clamp_to_page_size(self.index_size)); options.map_size(clamp_to_page_size(self.index_size));
options.max_readers(1024); options.max_readers(1024);
if date == None {
Ok(Index::new(options, path)?)
} else {
let (created, updated) = date.unwrap(); let (created, updated) = date.unwrap();
Ok(Index::new_with_creation_dates(options, path, created, updated)?) Ok(Index::new_with_creation_dates(options, path, created, updated)?)
} }
}
/// Get or create the index. /// Get or create the index.
pub fn create_index(&self, mut wtxn: RwTxn, name: &str, date: Option<(time::OffsetDateTime, time::OffsetDateTime)>) -> Result<Index> { pub fn create_index(&self, mut wtxn: RwTxn, name: &str, date: Option<(time::OffsetDateTime, time::OffsetDateTime)>) -> Result<Index> {