pub fn read(path: &Path, password: &str) -> VResult<Book> {
    Ok(EncryptedVault::from_bytes(&fs::read(path)?)
        .map_err(|_| Error::VaultCorrupted)?
        .decrypt(password)
        .ok_or(Error::WrongPassword)?
        .content)
}
/// Read an encrypted book from a file
Read an encrypted book from a file
Read an encrypted book from a file
pub fn read(path: &Path, password: &str) -> VResult<Book> {
    Ok(EncryptedVault::from_bytes(&fs::read(path)?)
        .map_err(|_| Error::VaultCorrupted)?
        .decrypt(password)
        .ok_or(Error::WrongPassword)?
        .content)
}
pub fn read ( path : & Path , password : & str ) -> VResult < Book > { Ok ( EncryptedVault :: from_bytes ( & fs :: read ( path ) ? ) . map_err ( | _ | Error :: VaultCorrupted ) ? . decrypt ( password ) . ok_or ( Error :: WrongPassword ) ? . content ) }
Read an encrypted book from a file
Read an encrypted book from a file
path
&Path
password
&str
path
&Path
password
&str