From 4bddfaa0fa81fc032ebe3c0d365d5ad9b7b70c0c Mon Sep 17 00:00:00 2001 From: Adrian Malacoda Date: Wed, 25 Oct 2017 22:21:53 -0500 Subject: [PATCH] should be create --- src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index ca692d4..206abb8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -162,9 +162,9 @@ impl Downloader { out_path.push(filename); if !out_path.exists() { - let mut res = reqwest::get(url).expect("failed to download url"); - let mut file = File::open(out_path.as_path()).expect("failed to open file"); - copy(&mut res, &mut file).expect("failed to write file"); + let mut result = reqwest::get(url).expect("failed to download url"); + let mut file = File::create(out_path.as_path()).expect("failed to open file"); + copy(&mut result, &mut file).expect("failed to write file"); } out_path