From 5338ff81a58482528d77f6a9468e836768a9c34f Mon Sep 17 00:00:00 2001 From: Edward Shen Date: Wed, 14 Jul 2021 14:00:02 -0400 Subject: [PATCH] Move impl block to correct location --- src/cache/fs.rs | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/cache/fs.rs b/src/cache/fs.rs index 498fc29..ec5e941 100644 --- a/src/cache/fs.rs +++ b/src/cache/fs.rs @@ -152,19 +152,6 @@ impl EncryptedReader { } } -#[async_trait] -pub trait MetadataFetch: AsyncBufRead { - async fn metadata(mut self: Pin<&mut Self>) -> Result; -} - -#[async_trait] -impl MetadataFetch for R { - #[inline] - async fn metadata(mut self: Pin<&mut Self>) -> Result { - MetadataFuture(self).await - } -} - impl AsyncRead for EncryptedReader { fn poll_read( mut self: Pin<&mut Self>, @@ -181,6 +168,19 @@ impl AsyncRead for EncryptedReader { } } +#[async_trait] +pub trait MetadataFetch: AsyncBufRead { + async fn metadata(mut self: Pin<&mut Self>) -> Result; +} + +#[async_trait] +impl MetadataFetch for R { + #[inline] + async fn metadata(mut self: Pin<&mut Self>) -> Result { + MetadataFuture(self).await + } +} + struct MetadataFuture<'a, R>(Pin<&'a mut R>); impl<'a, R: AsyncBufRead> Future for MetadataFuture<'a, R> {