fix: doc tests
This commit is contained in:
@@ -37,12 +37,10 @@ use super::{
|
||||
/// use rosu_pp::{Beatmap, Difficulty};
|
||||
/// use rosu_pp::catch::{Catch, CatchGradualDifficulty};
|
||||
///
|
||||
/// let converted = Beatmap::from_path("./resources/2118524.osu")
|
||||
/// .unwrap()
|
||||
/// .unchecked_into_converted::<Catch>();
|
||||
/// let map = Beatmap::from_path("./resources/2118524.osu").unwrap();
|
||||
///
|
||||
/// let difficulty = Difficulty::new().mods(64); // DT
|
||||
/// let mut iter = CatchGradualDifficulty::new(difficulty, &converted);
|
||||
/// let mut iter = CatchGradualDifficulty::new(difficulty, &map).unwrap();
|
||||
///
|
||||
/// // the difficulty of the map after the first hit object
|
||||
/// let attrs1 = iter.next();
|
||||
|
||||
@@ -25,12 +25,10 @@ use crate::{
|
||||
/// use rosu_pp::{Beatmap, Difficulty};
|
||||
/// use rosu_pp::catch::{Catch, CatchGradualPerformance, CatchScoreState};
|
||||
///
|
||||
/// let converted = Beatmap::from_path("./resources/2118524.osu")
|
||||
/// .unwrap()
|
||||
/// .unchecked_into_converted::<Catch>();
|
||||
/// let map = Beatmap::from_path("./resources/2118524.osu").unwrap();
|
||||
///
|
||||
/// let difficulty = Difficulty::new().mods(64); // DT
|
||||
/// let mut gradual = CatchGradualPerformance::new(difficulty, &converted);
|
||||
/// let mut gradual = CatchGradualPerformance::new(difficulty, &map).unwrap();
|
||||
/// let mut state = CatchScoreState::new(); // empty state, everything is on 0.
|
||||
///
|
||||
/// // The first 10 hitresults are only fruits
|
||||
|
||||
@@ -29,12 +29,10 @@ use super::{
|
||||
/// use rosu_pp::{Beatmap, Difficulty};
|
||||
/// use rosu_pp::mania::ManiaGradualDifficulty;
|
||||
///
|
||||
/// let converted = Beatmap::from_path("./resources/1638954.osu")
|
||||
/// .unwrap()
|
||||
/// .unchecked_into_converted();
|
||||
/// let map = Beatmap::from_path("./resources/1638954.osu").unwrap();
|
||||
///
|
||||
/// let difficulty = Difficulty::new().mods(64); // DT
|
||||
/// let mut iter = ManiaGradualDifficulty::new(difficulty, &converted);
|
||||
/// let mut iter = ManiaGradualDifficulty::new(difficulty, &map).unwrap();
|
||||
///
|
||||
/// // the difficulty of the map after the first hit object
|
||||
/// let attrs1 = iter.next();
|
||||
|
||||
@@ -20,12 +20,10 @@ use super::{ManiaPerformanceAttributes, ManiaScoreState};
|
||||
/// use rosu_pp::{Beatmap, Difficulty};
|
||||
/// use rosu_pp::mania::{Mania, ManiaGradualPerformance, ManiaScoreState};
|
||||
///
|
||||
/// let converted = Beatmap::from_path("./resources/1638954.osu")
|
||||
/// .unwrap()
|
||||
/// .unchecked_into_converted::<Mania>();
|
||||
/// let map = Beatmap::from_path("./resources/1638954.osu").unwrap();
|
||||
///
|
||||
/// let difficulty = Difficulty::new().mods(64); // DT
|
||||
/// let mut gradual = ManiaGradualPerformance::new(difficulty, &converted);
|
||||
/// let mut gradual = ManiaGradualPerformance::new(difficulty, &map).unwrap();
|
||||
/// let mut state = ManiaScoreState::new(); // empty state, everything is on 0.
|
||||
///
|
||||
/// // The first 10 hitresults are 320s
|
||||
|
||||
@@ -35,12 +35,10 @@ use super::{
|
||||
/// use rosu_pp::{Beatmap, Difficulty};
|
||||
/// use rosu_pp::osu::{Osu, OsuGradualDifficulty};
|
||||
///
|
||||
/// let converted = Beatmap::from_path("./resources/2785319.osu")
|
||||
/// .unwrap()
|
||||
/// .unchecked_into_converted::<Osu>();
|
||||
/// let map = Beatmap::from_path("./resources/2785319.osu").unwrap();
|
||||
///
|
||||
/// let difficulty = Difficulty::new().mods(64); // DT
|
||||
/// let mut iter = OsuGradualDifficulty::new(difficulty, &converted);
|
||||
/// let mut iter = OsuGradualDifficulty::new(difficulty, &map).unwrap();
|
||||
///
|
||||
/// // the difficulty of the map after the first hit object
|
||||
/// let attrs1 = iter.next();
|
||||
|
||||
@@ -20,12 +20,10 @@ use super::{OsuPerformanceAttributes, OsuScoreState};
|
||||
/// use rosu_pp::{Beatmap, Difficulty};
|
||||
/// use rosu_pp::osu::{Osu, OsuGradualPerformance, OsuScoreState};
|
||||
///
|
||||
/// let converted = Beatmap::from_path("./resources/2785319.osu")
|
||||
/// .unwrap()
|
||||
/// .unchecked_into_converted::<Osu>();
|
||||
/// let map = Beatmap::from_path("./resources/2785319.osu").unwrap();
|
||||
///
|
||||
/// let difficulty = Difficulty::new().mods(64); // DT
|
||||
/// let mut gradual = OsuGradualPerformance::new(difficulty, &converted);
|
||||
/// let mut gradual = OsuGradualPerformance::new(difficulty, &map).unwrap();
|
||||
/// let mut state = OsuScoreState::new(); // empty state, everything is on 0.
|
||||
///
|
||||
/// // The first 10 hits are 300s and there are no sliders for additional combo
|
||||
|
||||
@@ -30,12 +30,10 @@ use super::{
|
||||
/// use rosu_pp::{Beatmap, Difficulty};
|
||||
/// use rosu_pp::taiko::{Taiko, TaikoGradualDifficulty};
|
||||
///
|
||||
/// let converted = Beatmap::from_path("./resources/1028484.osu")
|
||||
/// .unwrap()
|
||||
/// .unchecked_into_converted::<Taiko>();
|
||||
/// let map = Beatmap::from_path("./resources/1028484.osu").unwrap();
|
||||
///
|
||||
/// let difficulty = Difficulty::new().mods(64); // DT
|
||||
/// let mut iter = TaikoGradualDifficulty::new(difficulty, &converted);
|
||||
/// let mut iter = TaikoGradualDifficulty::new(difficulty, &map).unwrap();
|
||||
///
|
||||
/// // the difficulty of the map after the first hit object
|
||||
/// let attrs1 = iter.next();
|
||||
|
||||
@@ -24,12 +24,10 @@ use super::TaikoPerformanceAttributes;
|
||||
/// use rosu_pp::{Beatmap, Difficulty};
|
||||
/// use rosu_pp::taiko::{Taiko, TaikoGradualPerformance, TaikoScoreState};
|
||||
///
|
||||
/// let converted = Beatmap::from_path("./resources/1028484.osu")
|
||||
/// .unwrap()
|
||||
/// .unchecked_into_converted::<Taiko>();
|
||||
/// let map = Beatmap::from_path("./resources/1028484.osu").unwrap();
|
||||
///
|
||||
/// let difficulty = Difficulty::new().mods(64); // DT
|
||||
/// let mut gradual = TaikoGradualPerformance::new(difficulty, &converted);
|
||||
/// let mut gradual = TaikoGradualPerformance::new(difficulty, &map).unwrap();
|
||||
/// let mut state = TaikoScoreState::new(); // empty state, everything is on 0.
|
||||
///
|
||||
/// // The first 10 hitresults are 300s
|
||||
|
||||
+4
-4
@@ -139,9 +139,9 @@ impl<T: fmt::Debug> fmt::Debug for Weak<T> {
|
||||
/// ```compile_fail
|
||||
/// use rosu_pp::{taiko::TaikoGradualDifficulty, Beatmap, Difficulty};
|
||||
///
|
||||
/// let converted = Beatmap::from_bytes(&[]).unwrap().unchecked_into_converted();
|
||||
/// let map = Beatmap::from_bytes(&[]).unwrap();
|
||||
/// let difficulty = Difficulty::new();
|
||||
/// let mut gradual = TaikoGradualDifficulty::new(&difficulty, &converted);
|
||||
/// let mut gradual = TaikoGradualDifficulty::new(&difficulty, &map).unwrap();
|
||||
///
|
||||
/// // Rc<RefCell<_>> cannot be shared across threads so compilation should fail
|
||||
/// std::thread::spawn(move || { let _ = gradual.next(); });
|
||||
@@ -155,8 +155,8 @@ mod tests {
|
||||
fn share_gradual_taiko() {
|
||||
use crate::{taiko::TaikoGradualDifficulty, Beatmap, Difficulty};
|
||||
|
||||
let converted = Beatmap::from_bytes(&[]).unwrap().unchecked_into_converted();
|
||||
let mut gradual = TaikoGradualDifficulty::new(Difficulty::new(), &converted);
|
||||
let map = Beatmap::from_bytes(&[]).unwrap();
|
||||
let mut gradual = TaikoGradualDifficulty::new(Difficulty::new(), &map).unwrap();
|
||||
|
||||
// Arc<RwLock<_>> *can* be shared across threads so this should compile
|
||||
std::thread::spawn(move || {
|
||||
|
||||
Reference in New Issue
Block a user