Fix hashes not showing (#496)

* Fix hashes not showing

* Run prepare + fmt
This commit is contained in:
Geometrically
2022-12-08 15:42:59 -07:00
committed by GitHub
parent d8b9d8431e
commit a5f9331023
3 changed files with 12 additions and 23 deletions

View File

@@ -452,21 +452,12 @@ impl From<QueryVersion> for Version {
files: data
.files
.into_iter()
.map(|f| {
VersionFile {
url: f.url,
filename: f.filename,
// FIXME: Hashes are currently stored as an ascii byte slice instead
// of as an actual byte array in the database
hashes: f
.hashes
.into_iter()
.map(|(k, v)| Some((k, String::from_utf8(v).ok()?)))
.collect::<Option<_>>()
.unwrap_or_default(),
primary: f.primary,
size: f.size,
}
.map(|f| VersionFile {
url: f.url,
filename: f.filename,
hashes: f.hashes,
primary: f.primary,
size: f.size,
})
.collect(),
dependencies: data