Skip to content

Commit

Permalink
fix: always clone mods (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxOhn authored Oct 23, 2024
1 parent e3c56ad commit 2a2039e
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/args/difficulty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,7 @@ pub struct DifficultyArgs {

impl DifficultyArgs {
pub fn to_difficulty(&self) -> Difficulty {
let mut difficulty = Difficulty::new();

difficulty = match self.mods.checked_bits() {
Some(bits) => difficulty.mods(bits),
None => difficulty.mods(self.mods.clone()),
};
let mut difficulty = Difficulty::new().mods(self.mods.clone());

if let Some(passed_objects) = self.passed_objects {
difficulty = difficulty.passed_objects(passed_objects);
Expand Down

0 comments on commit 2a2039e

Please sign in to comment.