mirror of
https://github.com/natsukagami/youmubot.git
synced 2025-05-24 17:20:49 +00:00
Massive dependencies bump
This commit is contained in:
parent
dd1867e222
commit
8632f0e99c
24 changed files with 744 additions and 841 deletions
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue