| Crates.io | opensource |
| lib.rs | opensource |
| version | 0.2.0 |
| created_at | 2016-06-17 18:58:40.640455+00 |
| updated_at | 2017-12-17 18:47:08.246872+00 |
| description | API Wrapper for the Open Source License API. |
| homepage | |
| repository | https://github.com/OpenSourceOrg/rust-opensource |
| max_upload_size | |
| id | 5412 |
| size | 11,389 |
rust-opensource is an API Wrapper that allows you to query the Open Source
License API with Rust.
The crate is called opensource and you can depend on it via cargo:
[dependencies]
opensource = "0.2.0"
Documentation can be found at OpenSourceOrg.github.io/rust-opensource.
extern crate opensource;
use opensource::client;
fn main() {
let license = client::get("BSD-3").unwrap();
println!("{}", license.name);
}
A better way is to use match:
extern crate opensource;
use opensource::client;
fn main() {
let license = client::get("this-license-does-not-exist");
match license {
Ok(license) => println!("{}", license.name),
Err(err) => println!("{}", err),
}
}