From 5f234f5f86212ec9919f9cd4d94d49ed7237c0f7 Mon Sep 17 00:00:00 2001 From: MaxOhn Date: Sun, 31 Mar 2024 23:50:32 +0200 Subject: [PATCH] adjusted documentation --- src/any/performance/mod.rs | 2 +- src/catch/performance/mod.rs | 10 ++++++++-- src/mania/performance/mod.rs | 10 ++++++++-- src/osu/performance/mod.rs | 10 ++++++++-- src/taiko/performance/mod.rs | 10 ++++++++-- 5 files changed, 33 insertions(+), 9 deletions(-) diff --git a/src/any/performance/mod.rs b/src/any/performance/mod.rs index fa0c3915..3e0647db 100644 --- a/src/any/performance/mod.rs +++ b/src/any/performance/mod.rs @@ -25,7 +25,7 @@ pub enum Performance<'map> { impl<'map> Performance<'map> { /// Create a new performance calculator for any mode. /// - /// `map_or_attrs` must be either + /// The argument `map_or_attrs` must be either /// - previously calculated attributes ([`DifficultyAttributes`], /// [`PerformanceAttributes`], or mode-specific attributes like /// [`TaikoDifficultyAttributes`], [`ManiaPerformanceAttributes`], ...) diff --git a/src/catch/performance/mod.rs b/src/catch/performance/mod.rs index 86a9fd76..301f3e6d 100644 --- a/src/catch/performance/mod.rs +++ b/src/catch/performance/mod.rs @@ -34,7 +34,7 @@ pub struct CatchPerformance<'map> { impl<'map> CatchPerformance<'map> { /// Create a new performance calculator for osu!catch maps. /// - /// `map_or_attrs` must be either + /// The argument `map_or_attrs` must be either /// - previously calculated attributes ([`CatchDifficultyAttributes`] /// or [`CatchPerformanceAttributes`]) /// - a beatmap ([`CatchBeatmap<'map>`]) @@ -54,9 +54,15 @@ impl<'map> CatchPerformance<'map> { /// Try to create a new performance calculator for osu!catch maps. /// - /// Returns `None` if `map_or_attrs` does not belong to osu!catch. + /// Returns `None` if `map_or_attrs` does not belong to osu!catch e.g. + /// a [`Converted`], [`DifficultyAttributes`], or [`PerformanceAttributes`] + /// of a different mode. /// /// See [`CatchPerformance::new`] for more information. + /// + /// [`Converted`]: crate::model::beatmap::Converted + /// [`DifficultyAttributes`]: crate::any::DifficultyAttributes + /// [`PerformanceAttributes`]: crate::any::PerformanceAttributes pub fn try_new(map_or_attrs: impl IntoPerformance<'map>) -> Option { if let Performance::Catch(calc) = map_or_attrs.into_performance() { Some(calc) diff --git a/src/mania/performance/mod.rs b/src/mania/performance/mod.rs index e3ebd8b3..83ccb510 100644 --- a/src/mania/performance/mod.rs +++ b/src/mania/performance/mod.rs @@ -35,7 +35,7 @@ pub struct ManiaPerformance<'map> { impl<'map> ManiaPerformance<'map> { /// Create a new performance calculator for osu!mania maps. /// - /// `map_or_attrs` must be either + /// The argument `map_or_attrs` must be either /// - previously calculated attributes ([`ManiaDifficultyAttributes`] /// or [`ManiaPerformanceAttributes`]) /// - a beatmap ([`ManiaBeatmap<'map>`]) @@ -55,9 +55,15 @@ impl<'map> ManiaPerformance<'map> { /// Try to create a new performance calculator for osu!mania maps. /// - /// Returns `None` if `map_or_attrs` does not belong to osu!mania. + /// Returns `None` if `map_or_attrs` does not belong to osu!mania e.g. + /// a [`Converted`], [`DifficultyAttributes`], or [`PerformanceAttributes`] + /// of a different mode. /// /// See [`ManiaPerformance::new`] for more information. + /// + /// [`Converted`]: crate::model::beatmap::Converted + /// [`DifficultyAttributes`]: crate::any::DifficultyAttributes + /// [`PerformanceAttributes`]: crate::any::PerformanceAttributes pub fn try_new(map_or_attrs: impl IntoPerformance<'map>) -> Option { if let Performance::Mania(calc) = map_or_attrs.into_performance() { Some(calc) diff --git a/src/osu/performance/mod.rs b/src/osu/performance/mod.rs index 19f8c3ea..df633695 100644 --- a/src/osu/performance/mod.rs +++ b/src/osu/performance/mod.rs @@ -37,7 +37,7 @@ pub struct OsuPerformance<'map> { impl<'map> OsuPerformance<'map> { /// Create a new performance calculator for osu! maps. /// - /// `map_or_attrs` must be either + /// The argument `map_or_attrs` must be either /// - previously calculated attributes ([`OsuDifficultyAttributes`] /// or [`OsuPerformanceAttributes`]) /// - a beatmap ([`OsuBeatmap<'map>`]) @@ -57,9 +57,15 @@ impl<'map> OsuPerformance<'map> { /// Try to create a new performance calculator for osu! maps. /// - /// Returns `None` if `map_or_attrs` does not belong to osu!. + /// Returns `None` if `map_or_attrs` does not belong to osu! e.g. + /// a [`Converted`], [`DifficultyAttributes`], or [`PerformanceAttributes`] + /// of a different mode. /// /// See [`OsuPerformance::new`] for more information. + /// + /// [`Converted`]: crate::model::beatmap::Converted + /// [`DifficultyAttributes`]: crate::any::DifficultyAttributes + /// [`PerformanceAttributes`]: crate::any::PerformanceAttributes pub fn try_new(map_or_attrs: impl IntoPerformance<'map>) -> Option { if let Performance::Osu(calc) = map_or_attrs.into_performance() { Some(calc) diff --git a/src/taiko/performance/mod.rs b/src/taiko/performance/mod.rs index 24a77573..bedea483 100644 --- a/src/taiko/performance/mod.rs +++ b/src/taiko/performance/mod.rs @@ -33,7 +33,7 @@ pub struct TaikoPerformance<'map> { impl<'map> TaikoPerformance<'map> { /// Create a new performance calculator for osu!taiko maps. /// - /// `map_or_attrs` must be either + /// The argument `map_or_attrs` must be either /// - previously calculated attributes ([`TaikoDifficultyAttributes`] /// or [`TaikoPerformanceAttributes`]) /// - a beatmap ([`TaikoBeatmap<'map>`]) @@ -53,9 +53,15 @@ impl<'map> TaikoPerformance<'map> { /// Try to create a new performance calculator for osu!taiko maps. /// - /// Returns `None` if `map_or_attrs` does not belong to osu!taiko. + /// Returns `None` if `map_or_attrs` does not belong to osu!taiko e.g. + /// a [`Converted`], [`DifficultyAttributes`], or [`PerformanceAttributes`] + /// of a different mode. /// /// See [`TaikoPerformance::new`] for more information. + /// + /// [`Converted`]: crate::model::beatmap::Converted + /// [`DifficultyAttributes`]: crate::any::DifficultyAttributes + /// [`PerformanceAttributes`]: crate::any::PerformanceAttributes pub fn try_new(map_or_attrs: impl IntoPerformance<'map>) -> Option { if let Performance::Taiko(calc) = map_or_attrs.into_performance() { Some(calc)