Skip to content

Commit

Permalink
test: fixed doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxOhn committed Nov 13, 2023
1 parent 046c853 commit ae8cc67
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/osu/pp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,9 @@ fn calculate_effective_misses(attrs: &OsuDifficultyAttributes, state: &OsuScoreS
}

fn accuracy(n300: usize, n100: usize, n50: usize, n_misses: usize) -> f64 {
debug_assert_ne!(n300 + n100 + n50 + n_misses, 0);
if n300 + n100 + n50 + n_misses == 0 {
return 0.0;
}

let numerator = 6 * n300 + 2 * n100 + n50;
let denominator = 6 * (n300 + n100 + n50 + n_misses);
Expand Down
4 changes: 3 additions & 1 deletion src/taiko/pp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,9 @@ impl<'map> From<OsuPP<'map>> for TaikoPP<'map> {
}

fn accuracy(n300: usize, n100: usize, n_misses: usize) -> f64 {
debug_assert_ne!(n300 + n100 + n_misses, 0);
if n300 + n100 + n_misses == 0 {
return 0.0;
}

let numerator = 2 * n300 + n100;
let denominator = 2 * (n300 + n100 + n_misses);
Expand Down

0 comments on commit ae8cc67

Please sign in to comment.