fixed build on some feature combinations

This commit is contained in:
MaxOhn
2021-11-24 23:14:08 +01:00
parent f0a221aee6
commit 0f1469cadd
4 changed files with 23 additions and 14 deletions
+17 -9
View File
@@ -1,11 +1,19 @@
use crate::{ use crate::{Beatmap, DifficultyAttributes, GameMode, Mods, PerformanceAttributes};
fruits::{
#[cfg(feature = "fruits")]
use crate::fruits::{
FruitsGradualDifficultyAttributes, FruitsGradualPerformanceAttributes, FruitsScoreState, FruitsGradualDifficultyAttributes, FruitsGradualPerformanceAttributes, FruitsScoreState,
}, };
mania::{ManiaGradualDifficultyAttributes, ManiaGradualPerformanceAttributes},
osu::{OsuGradualDifficultyAttributes, OsuGradualPerformanceAttributes, OsuScoreState}, #[cfg(feature = "mania")]
taiko::{TaikoGradualDifficultyAttributes, TaikoGradualPerformanceAttributes, TaikoScoreState}, use crate::mania::{ManiaGradualDifficultyAttributes, ManiaGradualPerformanceAttributes};
Beatmap, DifficultyAttributes, GameMode, Mods, PerformanceAttributes,
#[cfg(feature = "osu")]
use crate::osu::{OsuGradualDifficultyAttributes, OsuGradualPerformanceAttributes, OsuScoreState};
#[cfg(feature = "taiko")]
use crate::taiko::{
TaikoGradualDifficultyAttributes, TaikoGradualPerformanceAttributes, TaikoScoreState,
}; };
/// Gradually calculate the difficulty attributes on maps of any mode. /// Gradually calculate the difficulty attributes on maps of any mode.
@@ -19,7 +27,7 @@ use crate::{
/// ///
/// # Example /// # Example
/// ///
/// ``` /// ```no_run
/// use rosu_pp::{Beatmap, GradualDifficultyAttributes}; /// use rosu_pp::{Beatmap, GradualDifficultyAttributes};
/// ///
/// # /* /// # /*
@@ -228,7 +236,7 @@ impl From<ScoreState> for TaikoScoreState {
/// ///
/// # Example /// # Example
/// ///
/// ``` /// ```no_run
/// use rosu_pp::{Beatmap, GradualPerformanceAttributes, ScoreState}; /// use rosu_pp::{Beatmap, GradualPerformanceAttributes, ScoreState};
/// ///
/// # /* /// # /*
+3 -3
View File
@@ -496,11 +496,11 @@ impl PerformanceAttributes {
pub fn max_combo(&self) -> usize { pub fn max_combo(&self) -> usize {
match self { match self {
#[cfg(feature = "fruits")] #[cfg(feature = "fruits")]
Self::Fruits(f) => f.attributes.max_combo, Self::Fruits(f) => f.difficulty.max_combo,
#[cfg(feature = "osu")] #[cfg(feature = "osu")]
Self::Osu(o) => o.attributes.max_combo, Self::Osu(o) => o.difficulty.max_combo,
#[cfg(feature = "taiko")] #[cfg(feature = "taiko")]
Self::Taiko(t) => t.attributes.max_combo, Self::Taiko(t) => t.difficulty.max_combo,
} }
} }
} }
+1 -1
View File
@@ -16,7 +16,7 @@ use crate::taiko::{TaikoDifficultyAttributes, TaikoPP};
/// ///
/// # Example /// # Example
/// ///
/// ``` /// ```no_run
/// use rosu_pp::{AnyPP, Beatmap}; /// use rosu_pp::{AnyPP, Beatmap};
/// ///
/// # /* /// # /*
+1
View File
@@ -166,6 +166,7 @@ impl<'map> TaikoGradualPerformanceAttributes<'map> {
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
#[allow(unused_imports)]
use super::*; use super::*;
#[cfg(not(any(feature = "async_tokio", feature = "async_std")))] #[cfg(not(any(feature = "async_tokio", feature = "async_std")))]