Created
May 5, 2017 18:46
-
-
Save deankarn/9c814fb966a5eeb7bca7d8c11aab404c to your computer and use it in GitHub Desktop.
dl test
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 characters
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); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment