Massive dependencies bump

This commit is contained in:
Natsu Kagami 2022-06-11 15:48:43 -04:00
parent dd1867e222
commit 8632f0e99c
Signed by: nki
GPG key ID: 7306B3D3C3AD6E51
24 changed files with 744 additions and 841 deletions

View file

@ -64,16 +64,14 @@ impl youmubot_prelude::Announcer for Announcer {
if channels.is_empty() {
return; // We don't wanna update an user without any active server
}
match std::array::IntoIter::new([
Mode::Std,
Mode::Taiko,
Mode::Catch,
Mode::Mania,
])
.map(|m| s.handle_user_mode(&ctx, now, &osu_user, user_id, channels.clone(), m))
.collect::<stream::FuturesOrdered<_>>()
.try_collect::<Vec<_>>()
.await
match [Mode::Std, Mode::Taiko, Mode::Catch, Mode::Mania]
.into_iter()
.map(|m| {
s.handle_user_mode(&ctx, now, &osu_user, user_id, channels.clone(), m)
})
.collect::<stream::FuturesOrdered<_>>()
.try_collect::<Vec<_>>()
.await
{
Ok(v) => {
osu_user.last_update = now;

View file

@ -73,7 +73,7 @@ impl BeatmapMetaCache {
/// Get a beatmap without a mode...
pub async fn get_beatmap_default(&self, id: u64) -> Result<Beatmap> {
for mode in std::array::IntoIter::new([Mode::Std, Mode::Taiko, Mode::Catch, Mode::Mania]) {
for mode in [Mode::Std, Mode::Taiko, Mode::Catch, Mode::Mania].into_iter() {
if let Ok(Some(bm)) = self.get_beatmap_db(id, mode).await {
if bm.mode == mode {
return Ok(bm);

View file

@ -76,7 +76,7 @@ impl BeatmapContent {
/// Get info given mods.
pub fn get_info_with(&self, mods: Mods) -> Result<BeatmapInfo> {
let stars = self.content.stars(mods.bits() as u32, None);
let stars = self.content.stars().mods(mods.bits() as u32).calculate();
Ok(BeatmapInfo {
max_combo: stars.max_combo().unwrap_or(0),
objects: self.content.hit_objects.len(),