From 3df740702cdb5cd89016ad22304904a9c6b263c2 Mon Sep 17 00:00:00 2001 From: Geometrically <18202329+Geometrically@users.noreply.github.com> Date: Sat, 30 Jan 2021 16:51:32 -0700 Subject: [PATCH] Fix version hash (#154) --- src/database/models/version_item.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/database/models/version_item.rs b/src/database/models/version_item.rs index fa32e9baf..05fd99354 100644 --- a/src/database/models/version_item.rs +++ b/src/database/models/version_item.rs @@ -625,10 +625,14 @@ impl Version { let mut hashes : Vec<(FileId, String, Vec)> = Vec::new(); v.hashes.unwrap_or_default().split(" ,").for_each(|f| { - let hash : Vec<&str> = f.split(", ").collect(); + let hash: Vec<&str> = f.split(", ").collect(); - if hashes.len() >= 3 { - hashes.push((FileId(hash[2].parse().unwrap_or(0)), hash[0].to_string(), hash[1].to_string().into_bytes())); + if hash.len() >= 3 { + hashes.push(( + FileId(hash[2].parse().unwrap_or(0)), + hash[0].to_string(), + hash[1].to_string().into_bytes(), + )); } });