download_repo

Function download_repo 

Source
pub fn download_repo(
    delete_zip: bool,
    commit: Option<&str>,
) -> Result<(), Box<dyn Error>>
Expand description

Downloads the github SkyblockRepo data and unzips

You can additonally remove the downloaded zip and only keep the extracted directory by passing in true

Examples found in repository?
examples/basic.rs (line 7)
5fn main() {
6	let mut start = Instant::now();
7	download_repo(false, None).unwrap();
8	println!(
9		"Time taken to download and extract repo: {}s",
10		start.elapsed().as_secs_f32()
11	);
12	start = Instant::now();
13
14	let data = SkyblockRepo::new().unwrap();
15	println!(
16		"Time taken to parse repo: {}ms",
17		start.elapsed().as_millis()
18	);
19	start = Instant::now();
20
21	println!("{:?}", data.get_enchantment_by_id("TELEKINESIS"));
22	println!(
23		"Time taken to get data for `TELEKINESIS`: {}µs",
24		(start.elapsed().as_nanos() as f32 / 1_000.0)
25	);
26	start = Instant::now();
27
28	delete_repo().unwrap();
29	println!(
30		"Time taken to delete repo: {}ms",
31		start.elapsed().as_millis()
32	);
33}