Skip to content

Instantly share code, notes, and snippets.

View CKylinMC's full-sized avatar
:shipit:
Slow to reply.

CKylinMC CKylinMC

:shipit:
Slow to reply.
View GitHub Profile
@CKylinMC
CKylinMC / download_file.rs
Created May 22, 2023 03:04 — forked from giuliano-macedo/download_file.rs
Download large files in rust with progress bar using reqwest, future_util and indicatif
// you need this in your cargo.toml
// reqwest = { version = "0.11.3", features = ["stream"] }
// futures-util = "0.3.14"
// indicatif = "0.15.0"
use std::cmp::min;
use std::fs::File;
use std::io::Write;
use reqwest::Client;
use indicatif::{ProgressBar, ProgressStyle};