use published rosu-pp

This commit is contained in:
MaxOhn
2024-04-02 12:56:11 +02:00
parent 197d687b98
commit 0bbd18648e
3 changed files with 9 additions and 8 deletions
Generated
+2 -1
View File
@@ -191,7 +191,8 @@ checksum = "3c55926c8f0fed1db12fbe96f7a6083a2c4186443dd32532ab34e6902467a4f3"
[[package]]
name = "rosu-pp"
version = "1.0.0"
source = "git+https://github.com/MaxOhn/rosu-pp?branch=next#711e548a7e29289a42dc8a5ff58ee3e1299218a6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "26f146c66bed5900ee1fa2b55ef5cc5dd2dbd45e6cac0f7bee5cae535980afbc"
dependencies = [
"rosu-map",
]
+1 -1
View File
@@ -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
+6 -6
View File
@@ -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",