Skip to content

Commit

Permalink
Usage of extract_file_url inside of HashStream::init_from_file
Browse files Browse the repository at this point in the history
  • Loading branch information
pwalski authored and nieznanysprawiciel committed Feb 2, 2024
1 parent 76cc17c commit 7d56f1a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions exe-unit/components/transfer/src/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ where
}

pub fn try_started(stream: S, h: &TransferHash, target: &Url) -> Result<Self, Error> {
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<Self, Error> {
fn init_from_file(mut self, target: &Url) -> Result<Self, Error> {
let target = extract_file_url(target);
let mut file_src = OpenOptions::new().read(true).open(target)?;
let mut chunk = vec![0; 4096];

Expand Down

0 comments on commit 7d56f1a

Please sign in to comment.