Skip to content

Commit

Permalink
Make the Env::open_encrypted method create an EncryptedEnv
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerollmops committed Nov 30, 2024
1 parent c8efde1 commit ee91f89
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions heed/src/envs/env_open_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use std::{io, ptr};
use aead::{generic_array::typenum::Unsigned, AeadCore, AeadMutInPlace, Key, KeyInit};

#[cfg(master3)]
use super::encrypted_env::encrypt_func_wrapper;
use super::encrypted_env::{encrypt_func_wrapper, EncryptedEnv};
use super::env::Env;
use super::{canonicalize_path, OPENED_ENV};
#[cfg(windows)]
Expand Down Expand Up @@ -331,7 +331,7 @@ impl EnvOpenOptions {
/// # Ok(()) }
/// ```
#[cfg(master3)]
pub unsafe fn open_encrypted<E, P>(&self, key: Key<E>, path: P) -> Result<Env>
pub unsafe fn open_encrypted<E, P>(&self, key: Key<E>, path: P) -> Result<EncryptedEnv>
where
E: AeadMutInPlace + KeyInit,
P: AsRef<Path>,
Expand Down Expand Up @@ -405,7 +405,7 @@ impl EnvOpenOptions {
Ok(()) => {
let env_ptr = NonNull::new(env).unwrap();
debug_assert!(lock.insert(path.clone()));
Ok(Env::new(env_ptr, path))
Ok(EncryptedEnv { inner: Env::new(env_ptr, path) })
}
Err(e) => {
ffi::mdb_env_close(env);
Expand Down

0 comments on commit ee91f89

Please sign in to comment.