covid19 0.3.0

Wrapper for cv19api https://lbandc.github.io/2020/04/14/project-cv19api.html
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use super::data::{Countries, Places, Regions};
use anyhow::Result;

use crate::utils::fetch;

const BASE_URL: &str = "https://coviddata.github.io/coviddata/";

pub fn countries_data() -> Result<Countries> {
    fetch(&format!("{}{}", BASE_URL, "v1/countries/stats.json"))
}

pub fn regions_data() -> Result<Regions> {
    fetch(&format!("{}{}", BASE_URL, "v1/regions/stats.json"))
}

pub fn places_data() -> Result<Places> {
    fetch(&format!("{}{}", BASE_URL, "v1/places/stats.json"))
}