Run fmt, fix dep route (#312)

This commit is contained in:
Geometrically
2022-02-27 21:44:00 -07:00
committed by GitHub
parent 725f8571bb
commit 459e36c027
53 changed files with 1798 additions and 867 deletions

View File

@@ -127,7 +127,10 @@ pub mod base62_impl {
impl<'de> Visitor<'de> for Base62Visitor {
type Value = Base62Id;
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
fn expecting(
&self,
formatter: &mut std::fmt::Formatter,
) -> std::fmt::Result {
formatter.write_str("a base62 string id")
}
@@ -183,7 +186,9 @@ pub mod base62_impl {
}
// We don't want this panicking or wrapping on integer overflow
if let Some(n) = num.checked_mul(62).and_then(|n| n.checked_add(next_digit)) {
if let Some(n) =
num.checked_mul(62).and_then(|n| n.checked_add(next_digit))
{
num = n;
} else {
return Err(DecodingError::Overflow);

View File

@@ -360,10 +360,16 @@ impl From<QueryVersion> for Version {
.map(|d| Dependency {
version_id: d.version_id.map(|i| VersionId(i.0 as u64)),
project_id: d.project_id.map(|i| ProjectId(i.0 as u64)),
dependency_type: DependencyType::from_str(d.dependency_type.as_str()),
dependency_type: DependencyType::from_str(
d.dependency_type.as_str(),
),
})
.collect(),
game_versions: data.game_versions.into_iter().map(GameVersion).collect(),
game_versions: data
.game_versions
.into_iter()
.map(GameVersion)
.collect(),
loaders: data.loaders.into_iter().map(Loader).collect(),
}
}