Skip to content

Commit

Permalink
refactor[packwiz]: use .map() and .ok()
Browse files Browse the repository at this point in the history
  • Loading branch information
null8626 committed Feb 2, 2024
1 parent 4f31b58 commit 12c603e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/interop/packwiz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,14 @@ impl<'a> PackwizInterop<'a> {
};

Ok(
match self.0.modrinth().version_from_hash(&down.hash, fmt).await {
Ok(ver) => Some(Downloadable::Modrinth {
self.0.modrinth()
.version_from_hash(&down.hash, fmt)
.await
.map(|ver| Downloadable::Modrinth {
id: ver.project_id.clone(),
version: ver.id.clone(),
}),
_ => None,
},
})
.ok()
)
}
}
Expand Down

0 comments on commit 12c603e

Please sign in to comment.