From 649c5ee7b116d6240b357ee265a09990a67f5e64 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Wed, 16 Oct 2019 13:23:52 +0200 Subject: [PATCH] load_and_decrtypt_key: allow function closures to readf passphrase --- src/backup/key_derivation.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backup/key_derivation.rs b/src/backup/key_derivation.rs index 40f7e0ae..abe314b9 100644 --- a/src/backup/key_derivation.rs +++ b/src/backup/key_derivation.rs @@ -148,7 +148,7 @@ pub fn encrypt_key_with_passphrase( }) } -pub fn load_and_decrtypt_key(path: &std::path::Path, passphrase: fn() -> Result, Error>) -> Result<([u8;32], DateTime), Error> { +pub fn load_and_decrtypt_key(path: &std::path::Path, passphrase: &dyn Fn() -> Result, Error>) -> Result<([u8;32], DateTime), Error> { let raw = file_get_contents(&path)?; let data = String::from_utf8(raw)?;