diff --git a/milli/src/index.rs b/milli/src/index.rs index b64aafbb3..4b15820f6 100644 --- a/milli/src/index.rs +++ b/milli/src/index.rs @@ -268,21 +268,10 @@ impl Index { ) -> heed::Result<()> { let mut txn = env.write_txn()?; // The db was just created, we update its metadata with the relevant information. - if main - .remap_types::>() - .get(&txn, main_key::CREATED_AT_KEY)? - .is_none() - { - main.remap_types::>().put( - &mut txn, - main_key::UPDATED_AT_KEY, - &updated_at, - )?; - main.remap_types::>().put( - &mut txn, - main_key::CREATED_AT_KEY, - &created_at, - )?; + let main = main.remap_types::>(); + if main.get(&txn, main_key::CREATED_AT_KEY)?.is_none() { + main.put(&mut txn, main_key::UPDATED_AT_KEY, &updated_at)?; + main.put(&mut txn, main_key::CREATED_AT_KEY, &created_at)?; txn.commit()?; } Ok(())