Skip to content

Instantly share code, notes, and snippets.

@deankarn
Created May 5, 2017 18:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deankarn/9c814fb966a5eeb7bca7d8c11aab404c to your computer and use it in GitHub Desktop.
Save deankarn/9c814fb966a5eeb7bca7d8c11aab404c to your computer and use it in GitHub Desktop.
dl test
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