From bf78758f077fd075ecc1921863e06d4b9400ed19 Mon Sep 17 00:00:00 2001 From: Badewanne3 <41148446+MaxOhn@users.noreply.github.com> Date: Sat, 30 Dec 2023 10:27:05 +0100 Subject: [PATCH] doc: fix intra-doc links (#30) --- src/catch/mod.rs | 9 ++++++--- src/catch/pp.rs | 9 ++++++--- src/mania/mod.rs | 9 ++++++--- src/mania/pp.rs | 9 ++++++--- src/osu/mod.rs | 9 ++++++--- src/osu/pp.rs | 9 ++++++--- src/pp.rs | 9 ++++++--- src/score_state.rs | 2 -- src/stars.rs | 9 ++++++--- src/taiko/mod.rs | 9 ++++++--- src/taiko/pp.rs | 9 ++++++--- 11 files changed, 60 insertions(+), 32 deletions(-) diff --git a/src/catch/mod.rs b/src/catch/mod.rs index 04bc5f90..54e98794 100644 --- a/src/catch/mod.rs +++ b/src/catch/mod.rs @@ -81,9 +81,12 @@ impl<'map> CatchStars<'map> { /// Amount of passed objects for partial plays, e.g. a fail. /// - /// If you want to calculate the difficulty after every few objects, instead of - /// using [`CatchStars`] multiple times with different `passed_objects`, you should use - /// [`CatchGradualDifficultyAttributes`](crate::catch::CatchGradualDifficulty). + #[cfg_attr( + feature = "gradual", + doc = "If you want to calculate the difficulty after every few objects, instead of + using [`CatchStars`] multiple times with different `passed_objects`, you should use + [`CatchGradualDifficultyAttributes`](crate::catch::CatchGradualDifficulty)." + )] #[inline] pub fn passed_objects(mut self, passed_objects: usize) -> Self { self.passed_objects = Some(passed_objects); diff --git a/src/catch/pp.rs b/src/catch/pp.rs index 61820771..ba8a50bc 100644 --- a/src/catch/pp.rs +++ b/src/catch/pp.rs @@ -143,9 +143,12 @@ impl<'map> CatchPP<'map> { /// Amount of passed objects for partial plays, e.g. a fail. /// - /// If you want to calculate the performance after every few objects, instead of - /// using [`CatchPP`] multiple times with different `passed_objects`, you should use - /// [`CatchGradualPerformanceAttributes`](crate::catch::CatchGradualPerformance). + #[cfg_attr( + feature = "gradual", + doc = "If you want to calculate the performance after every few objects, instead of + using [`CatchPP`] multiple times with different `passed_objects`, you should use + [`CatchGradualPerformanceAttributes`](crate::catch::CatchGradualPerformance)." + )] #[inline] pub fn passed_objects(mut self, passed_objects: usize) -> Self { self.passed_objects = Some(passed_objects); diff --git a/src/mania/mod.rs b/src/mania/mod.rs index b74ce05a..cb895add 100644 --- a/src/mania/mod.rs +++ b/src/mania/mod.rs @@ -86,9 +86,12 @@ impl<'map> ManiaStars<'map> { /// Amount of passed objects for partial plays, e.g. a fail. /// - /// If you want to calculate the difficulty after every few objects, instead of - /// using [`ManiaStars`] multiple times with different `passed_objects`, you should use - /// [`ManiaGradualDifficultyAttributes`](crate::mania::ManiaGradualDifficulty). + #[cfg_attr( + feature = "gradual", + doc = "If you want to calculate the difficulty after every few objects, instead of + using [`ManiaStars`] multiple times with different `passed_objects`, you should use + [`ManiaGradualDifficultyAttributes`](crate::mania::ManiaGradualDifficulty)." + )] #[inline] pub fn passed_objects(mut self, passed_objects: usize) -> Self { self.passed_objects = Some(passed_objects); diff --git a/src/mania/pp.rs b/src/mania/pp.rs index 75ee92e2..e577e386 100644 --- a/src/mania/pp.rs +++ b/src/mania/pp.rs @@ -106,9 +106,12 @@ impl<'map> ManiaPP<'map> { /// Amount of passed objects for partial plays, e.g. a fail. /// - /// If you want to calculate the performance after every few objects, instead of - /// using [`ManiaPP`] multiple times with different `passed_objects`, you should use - /// [`ManiaGradualPerformanceAttributes`](crate::mania::ManiaGradualPerformance). + #[cfg_attr( + feature = "gradual", + doc = "If you want to calculate the performance after every few objects, instead of + using [`ManiaPP`] multiple times with different `passed_objects`, you should use + [`ManiaGradualPerformanceAttributes`](crate::mania::ManiaGradualPerformance)." + )] #[inline] pub fn passed_objects(mut self, passed_objects: usize) -> Self { self.passed_objects = Some(passed_objects); diff --git a/src/osu/mod.rs b/src/osu/mod.rs index 43adecd7..f6a4f987 100644 --- a/src/osu/mod.rs +++ b/src/osu/mod.rs @@ -100,9 +100,12 @@ impl<'map> OsuStars<'map> { /// Amount of passed objects for partial plays, e.g. a fail. /// - /// If you want to calculate the difficulty after every few objects, instead of - /// using [`OsuStars`] multiple times with different `passed_objects`, you should use - /// [`OsuGradualDifficulty`]. + #[cfg_attr( + feature = "gradual", + doc = "If you want to calculate the difficulty after every few objects, instead of + using [`OsuStars`] multiple times with different `passed_objects`, you should use + [`OsuGradualDifficulty`]." + )] #[inline] pub fn passed_objects(mut self, passed_objects: usize) -> Self { self.passed_objects = Some(passed_objects); diff --git a/src/osu/pp.rs b/src/osu/pp.rs index 934c1d18..95b16313 100644 --- a/src/osu/pp.rs +++ b/src/osu/pp.rs @@ -162,9 +162,12 @@ impl<'map> OsuPP<'map> { /// Amount of passed objects for partial plays, e.g. a fail. /// - /// If you want to calculate the performance after every few objects, instead of - /// using [`OsuPP`] multiple times with different `passed_objects`, you should use - /// [`OsuGradualPerformanceAttributes`](crate::osu::OsuGradualPerformance). + #[cfg_attr( + feature = "gradual", + doc = "If you want to calculate the performance after every few objects, instead of + using [`OsuPP`] multiple times with different `passed_objects`, you should use + [`OsuGradualPerformanceAttributes`](crate::osu::OsuGradualPerformance)." + )] #[inline] pub fn passed_objects(mut self, passed_objects: usize) -> Self { self.passed_objects = Some(passed_objects); diff --git a/src/pp.rs b/src/pp.rs index 6aa6aba7..c6380050 100644 --- a/src/pp.rs +++ b/src/pp.rs @@ -123,9 +123,12 @@ impl<'map> AnyPP<'map> { /// Amount of passed objects for partial plays, e.g. a fail. /// - /// If you want to calculate the performance after every few objects, instead of - /// using [`AnyPP`] multiple times with different `passed_objects`, you should use - /// [`GradualPerformanceAttributes`](crate::GradualPerformance). + #[cfg_attr( + feature = "gradual", + doc = "If you want to calculate the performance after every few objects, instead of + using [`AnyPP`] multiple times with different `passed_objects`, you should use + [`GradualPerformanceAttributes`](crate::GradualPerformance)." + )] #[inline] pub fn passed_objects(self, passed_objects: usize) -> Self { match self { diff --git a/src/score_state.rs b/src/score_state.rs index 13df36ec..a0994a5e 100644 --- a/src/score_state.rs +++ b/src/score_state.rs @@ -6,8 +6,6 @@ use crate::{ /// Aggregation for a score's current state i.e. what is /// the maximum combo so far, what are the current /// hitresults and what is the current score. -/// -/// This struct is used for [`GradualPerformance`](crate::GradualPerformance). #[derive(Clone, Debug, Default, Eq, PartialEq)] pub struct ScoreState { /// Maximum combo that the score has had so far. diff --git a/src/stars.rs b/src/stars.rs index 3b2de056..ce0c0b79 100644 --- a/src/stars.rs +++ b/src/stars.rs @@ -73,9 +73,12 @@ impl<'map> AnyStars<'map> { /// Amount of passed objects for partial plays, e.g. a fail. /// - /// If you want to calculate the performance after every few objects, instead of - /// using [`AnyStars`] multiple times with different `passed_objects`, you should use - /// [`GradualDifficultyAttributes`](crate::GradualDifficulty). + #[cfg_attr( + feature = "gradual", + doc = "If you want to calculate the performance after every few objects, instead of + using [`AnyStars`] multiple times with different `passed_objects`, you should use + [`GradualDifficultyAttributes`](crate::GradualDifficulty)." + )] #[inline] pub fn passed_objects(self, passed_objects: usize) -> Self { match self { diff --git a/src/taiko/mod.rs b/src/taiko/mod.rs index d3038d23..d880f445 100644 --- a/src/taiko/mod.rs +++ b/src/taiko/mod.rs @@ -90,9 +90,12 @@ impl<'map> TaikoStars<'map> { /// Amount of passed objects for partial plays, e.g. a fail. /// - /// If you want to calculate the difficulty after every few objects, instead of - /// using [`TaikoStars`] multiple times with different `passed_objects`, you should use - /// [`TaikoGradualDifficultyAttributes`](crate::taiko::TaikoGradualDifficulty). + #[cfg_attr( + feature = "gradual", + doc = "If you want to calculate the difficulty after every few objects, instead of + using [`TaikoStars`] multiple times with different `passed_objects`, you should use + [`TaikoGradualDifficultyAttributes`](crate::taiko::TaikoGradualDifficulty)." + )] #[inline] pub fn passed_objects(mut self, passed_objects: usize) -> Self { self.passed_objects = Some(passed_objects); diff --git a/src/taiko/pp.rs b/src/taiko/pp.rs index 89862a93..15d67049 100644 --- a/src/taiko/pp.rs +++ b/src/taiko/pp.rs @@ -148,9 +148,12 @@ impl<'map> TaikoPP<'map> { /// Amount of passed objects for partial plays, e.g. a fail. /// - /// If you want to calculate the performance after every few objects, instead of - /// using [`TaikoPP`] multiple times with different `passed_objects`, you should use - /// [`TaikoGradualPerformanceAttributes`](crate::taiko::TaikoGradualPerformance). + #[cfg_attr( + feature = "gradual", + doc = "If you want to calculate the performance after every few objects, instead of + using [`TaikoPP`] multiple times with different `passed_objects`, you should use + [`TaikoGradualPerformanceAttributes`](crate::taiko::TaikoGradualPerformance)." + )] #[inline] pub fn passed_objects(mut self, passed_objects: usize) -> Self { self.passed_objects = Some(passed_objects);