Repository: EmbarkStudios/cargo-about (language: rust)

Issue:
Package listed under the wrong license.
**Describe the bug**
When I attempted to build a licenses info file one crate was accepted and used under the wrong license.

**To Reproduce**
* Depend on the `ultraviolet` crate, which allows the "Zlib" license ([cargo file](https://github.com/termhn/ultraviolet/blob/master/Cargo.toml#L10)).
* Create a licenses accepted file which lists "Zlib" before MIT or Apache-2.0
```toml
accepted = [
  "Zlib",
  "Apache-2.0",
  "MIT",
]
```
The output licenses file will list `ultraviolet` as MIT licensed rather than Zlib licensed.

**Expected behavior**
`ultraviolet` should be accepted under the "Zlib" licenses section since that's higher priority in the toml file and it's also an allowed license of the crate.



Discussion / hints:

Fix patch:
diff --git a/src/licenses/mod.rs b/src/licenses/mod.rs
index e8ea240..4546a5c 100644
--- a/src/licenses/mod.rs
+++ b/src/licenses/mod.rs
@@ -555,9 +555,9 @@ impl Resolved {
             // in the license expression
             match krate_license.lic_info {
                 LicenseInfo::Expr(ref expr) => {
-                    let req = expr.requirements().map(|expr| expr.req.clone()).find(|req| {
-                        accepted.iter().any(|licensee| licensee.satisfies(&req))
-                    })
+                    let req = accepted.iter().find_map(|licensee| {
+                        expr.requirements().find(|expr| licensee.satisfies(&expr.req))
+                    }).map(|expr| expr.req.clone())
                     .context(format!(
                         "Crate '{}': Unable to satisfy [{}], with the following accepted licenses {}", krate_license.krate.name,
                         expr, DisplayList(accepted)


Test patch: