Created
May 5, 2017 18:46
Revisions
-
Dean Karn created this gist
May 5, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ extern crate download; use std::{io, fs}; use std::io::{Read, Write}; #[test] fn test_open(){ let mut file = download::open("http://storage.googleapis.com/golang/go1.8.1.linux-amd64.tar.gz").unwrap(); println!("{:?}",file); let mut f = fs::File::create("/home/joeybloggs/Downloads/download.zip").unwrap(); println!("{:?}",f); let written = io::copy(&mut file,&mut f); println!("{:?}, {:?}",file, written); assert_eq!(true,true); }