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];