/// Fetch the database from the given URL.
Fetch the database from the given URL.
Fetch the database from the given URL .
pub fn fetch(url: &str) -> eyre::Result<Db> {
        let mut db = ureq::get(&format!("{}/features.json", url))
            .set("user-agent", &format!("{}/{}", UA_NAME, UA_VERSION))
            .call()?
            .into_json::<Db>()?;
        db.base_url = url.to_owned();
        // fill in slugs with map key
        for (slug, feature) in &mut db.features {
            feature.slug = slug.clone()
        }
        Ok(db)
    }
pub fn fetch ( url : & str ) -> eyre :: Result < Db > { let mut db = ureq :: get ( & format ! ( " " url ) ) . set ( " " , & format ! ( " " UA_NAME UA_VERSION ) ) . call ( ) ? . into_json :: < Db > ( ) ? ; db . base_url = url . to_owned ( ) ; // fill in slugs with map key for ( slug , feature ) in & mut db . features { feature . slug = slug . clone ( ) } Ok ( db ) }
Fetch the database from the given URL.
Fetch the database from the given URL .
url
&str