Skip to content

Commit

Permalink
use published rosu-pp
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxOhn committed Apr 2, 2024
1 parent e8e395c commit abd77a3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ crate-type = ["cdylib"]

[dependencies]
pyo3 = { version = "0.21", features = ["extension-module", "macros"] }
rosu-pp = { git = "https://github.com/MaxOhn/rosu-pp", branch = "next", features = ["sync"] }
rosu-pp = { version = "1.0.0", features = ["sync"] }

[profile.release]
lto = true
Expand Down
12 changes: 6 additions & 6 deletions src/performance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,16 +205,16 @@ impl PyPerformance {
}

fn calculate(&self, args: &Bound<'_, PyAny>) -> PyResult<PyPerformanceAttributes> {
let _map;
let map;

let mut perf = if let Ok(attrs) = args.extract::<PyPerformanceAttributes>() {
Performance::from_attributes(DifficultyAttributes::try_from(attrs.difficulty)?)
Performance::new(DifficultyAttributes::try_from(attrs.difficulty)?)
} else if let Ok(attrs) = args.extract::<PyDifficultyAttributes>() {
Performance::from_attributes(DifficultyAttributes::try_from(attrs)?)
} else if let Ok(map) = args.extract::<PyRef<'_, PyBeatmap>>() {
_map = map;
Performance::new(DifficultyAttributes::try_from(attrs)?)
} else if let Ok(map_) = args.extract::<PyRef<'_, PyBeatmap>>() {
map = map_;

Performance::from_map(&_map.inner)
Performance::new(&map.inner)
} else {
return Err(ArgsError::new_err(
"argument must be DifficultyAttributes, PerformanceAttributes, or a Beatmap",
Expand Down

0 comments on commit abd77a3

Please sign in to comment.