INNER CODE UNIT · Rust

crates_io_info

flosse/rust-web-framework-comparison · src/main.rs:488

fn crates_io_info(name: &str, crates_io: &Option<String>) -> CratesIoInfo {
    if let Some(crate_name) = crates_io {
        let docs = format!("[![Docs](https://img.shields.io/static/v1?label=docs.rs&message={crate_name}&color=green)](https://docs.rs/{crate_name}/)");
        let license = format!(
            "![{name} license](https://img.shields.io/crates/l/{crate_name}.svg?label=%20)"
        );
        let version = format!(
            "![{name} version](https://img.shields.io/crates/v/{crate_name}.svg?label=%20)"
        );
        CratesIoInfo {
            license,
            docs,
            version,
        }
    } else {
        CratesIoInfo::default()
    }
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…