diff --git a/src/cache/fs.rs b/src/cache/fs.rs index 10bf6b4..ba6ba72 100644 --- a/src/cache/fs.rs +++ b/src/cache/fs.rs @@ -138,13 +138,13 @@ async fn read_file( } } -struct EncryptedDiskReader { - file: Pin>, +struct EncryptedDiskReader { + file: Pin>, keystream: XChaCha20, } -impl EncryptedDiskReader { - fn new(file: File, nonce: &XNonce, key: &Key) -> Self { +impl EncryptedDiskReader { + fn new(file: R, nonce: &XNonce, key: &Key) -> Self { Self { file: Box::pin(file), keystream: XChaCha20::new(key, nonce), @@ -165,7 +165,7 @@ impl MetadataFetch for R { } } -impl AsyncRead for EncryptedDiskReader { +impl AsyncRead for EncryptedDiskReader { fn poll_read( mut self: Pin<&mut Self>, cx: &mut Context<'_>,