Skip to content

Commit

Permalink
adjusted documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxOhn committed Mar 31, 2024
1 parent 94706bc commit 5f234f5
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/any/performance/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`], ...)
Expand Down
10 changes: 8 additions & 2 deletions src/catch/performance/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>`])
Expand All @@ -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<Self> {
if let Performance::Catch(calc) = map_or_attrs.into_performance() {
Some(calc)
Expand Down
10 changes: 8 additions & 2 deletions src/mania/performance/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>`])
Expand All @@ -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<Self> {
if let Performance::Mania(calc) = map_or_attrs.into_performance() {
Some(calc)
Expand Down
10 changes: 8 additions & 2 deletions src/osu/performance/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>`])
Expand All @@ -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<Self> {
if let Performance::Osu(calc) = map_or_attrs.into_performance() {
Some(calc)
Expand Down
10 changes: 8 additions & 2 deletions src/taiko/performance/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>`])
Expand All @@ -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<Self> {
if let Performance::Taiko(calc) = map_or_attrs.into_performance() {
Some(calc)
Expand Down

0 comments on commit 5f234f5

Please sign in to comment.