rs-dev-license 0.1.0
Identify common open source licenses from their text, and check SPDX license identifiers and expressions
Install
cargo add rs-dev-license --registry rupm
In Ruststudio: Packages, search for rs-dev-license, Install.
Owner: Rust Studio. Licence: MIT OR Apache-2.0. Total downloads: 0. Published 2026-11-23.
Versions
- 0.1.0 2026-11-23
README
# rs-dev-license
Identify common open source licenses from their text, and check SPDX license identifiers and expressions
Add it with `rupm add rs-dev-license` (or `cargo add rs-dev-license --registry rupm`).
```rust
let text = "Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction ... shall be included in all copies or substantial portions of the Software.";
assert_eq!(rs_dev_license::identify(text).unwrap().id, "MIT");
assert!(rs_dev_license::is_spdx_id("Apache-2.0"));
assert_eq!(rs_dev_license::canonical_id("apache-2.0"), Some("Apache-2.0"));
assert_eq!(rs_dev_license::expression_ids("MIT OR Apache-2.0").unwrap(), ["MIT", "Apache-2.0"]);
assert!(rs_dev_license::expression_ids("MIT OR Made-Up").is_err());
```