nit: use if let Some() here

This commit is contained in:
Kat Marchán 2019-06-04 23:56:45 +02:00
parent 257fc9b6d0
commit e5aeb669b4
No known key found for this signature in database
GPG Key ID: AEB529C08A3C7E9E
1 changed files with 1 additions and 2 deletions

View File

@ -109,8 +109,7 @@ pub fn find(cache: &Path, key: &str) -> Result<Option<Entry>, Error> {
let bucket = bucket_path(cache, &key);
Ok(bucket_entries(&bucket)?.into_iter().fold(None, |acc, entry| {
if entry.key == key {
if entry.integrity.is_some() {
let integrity = entry.integrity.unwrap();
if let Some(integrity) = entry.integrity {
let integrity: Integrity = match integrity.parse() {
Ok(sri) => sri,
_ => return acc