From 7d56f1a19209c06580966008c9b7fdebbf5d481c Mon Sep 17 00:00:00 2001 From: Przemyslaw Walski Date: Fri, 2 Feb 2024 17:45:01 +0100 Subject: [PATCH] Usage of extract_file_url inside of HashStream::init_from_file --- exe-unit/components/transfer/src/hash.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exe-unit/components/transfer/src/hash.rs b/exe-unit/components/transfer/src/hash.rs index 0efdf15c3b..ad350354d9 100644 --- a/exe-unit/components/transfer/src/hash.rs +++ b/exe-unit/components/transfer/src/hash.rs @@ -87,11 +87,11 @@ where } pub fn try_started(stream: S, h: &TransferHash, target: &Url) -> Result { - let target = extract_file_url(target); - Self::try_new(stream, &h.alg, h.val.clone())?.init_from_file(&target) + Self::try_new(stream, &h.alg, h.val.clone())?.init_from_file(target) } - fn init_from_file(mut self, target: &str) -> Result { + fn init_from_file(mut self, target: &Url) -> Result { + let target = extract_file_url(target); let mut file_src = OpenOptions::new().read(true).open(target)?; let mut chunk = vec![0; 4096];