From c19fcb697af9f77da4002400b605167e7c6da4d0 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 5 Jun 2024 00:16:58 +1000 Subject: [PATCH] Add new fn `Download::with_data_verifier` Signed-off-by: Jiahao XU --- crates/binstalk-downloader/src/download.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/binstalk-downloader/src/download.rs b/crates/binstalk-downloader/src/download.rs index caf9b2f8..e3e1c2f8 100644 --- a/crates/binstalk-downloader/src/download.rs +++ b/crates/binstalk-downloader/src/download.rs @@ -154,6 +154,13 @@ impl<'a> Download<'a> { } } + pub fn with_data_verifier<'d>(self, data_verifier: &'d mut dyn DataVerifier) -> Download<'d> { + Download { + content: self.content, + data_verifier: Some(data_verifier), + } + } + async fn get_stream( self, ) -> Result<