Function spdx::imprecise_license_id[][src]

pub fn imprecise_license_id(name: &str) -> Option<(LicenseId, usize)>

Find license partially matching the name, e.g. "apache" => "Apache-2.0" Returns length (in bytes) of the string matched. Garbage at the end is ignored. See identifiers::IMPRECISE_NAMES for the list of invalid names, and the valid license identifiers they are paired with.

assert!(spdx::imprecise_license_id("simplified bsd license").unwrap().0 == spdx::license_id("BSD-2-Clause").unwrap());