restructured StarResult to unify modes
This commit is contained in:
+2
-4
@@ -31,9 +31,7 @@ pub fn stars(map: &Beatmap, mods: impl Mods, passed_objects: Option<usize>) -> S
|
||||
let take = passed_objects.unwrap_or_else(|| map.hit_objects.len());
|
||||
|
||||
if take < 2 {
|
||||
return StarResult::Fruits {
|
||||
attributes: DifficultyAttributes::default(),
|
||||
};
|
||||
return StarResult::Fruits(DifficultyAttributes::default());
|
||||
}
|
||||
|
||||
let attributes = map.attributes().mods(mods);
|
||||
@@ -275,7 +273,7 @@ pub fn stars(map: &Beatmap, mods: impl Mods, passed_objects: Option<usize>) -> S
|
||||
max_combo: fruits + droplets,
|
||||
};
|
||||
|
||||
StarResult::Fruits { attributes }
|
||||
StarResult::Fruits(attributes)
|
||||
}
|
||||
|
||||
/// Essentially the same as the `stars` function but instead of
|
||||
|
||||
+2
-2
@@ -13,7 +13,7 @@ impl FruitsAttributeProvider for DifficultyAttributes {
|
||||
|
||||
impl FruitsAttributeProvider for StarResult {
|
||||
fn attributes(self) -> Option<DifficultyAttributes> {
|
||||
if let Self::Fruits { attributes } = self {
|
||||
if let Self::Fruits(attributes) = self {
|
||||
Some(attributes)
|
||||
} else {
|
||||
None
|
||||
@@ -286,7 +286,7 @@ impl<'m> FruitsPP<'m> {
|
||||
|
||||
PpResult {
|
||||
pp,
|
||||
attributes: StarResult::Fruits { attributes },
|
||||
attributes: StarResult::Fruits(attributes),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user