From 4a67e4f73bc719a0392263c116b02ecd944e4462 Mon Sep 17 00:00:00 2001 From: Natsu Kagami Date: Wed, 14 Feb 2024 02:11:25 +0100 Subject: [PATCH] Simply use v2 for lazer scores --- youmubot-osu/src/models/mods.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/youmubot-osu/src/models/mods.rs b/youmubot-osu/src/models/mods.rs index 2a100f5..0f1de0d 100644 --- a/youmubot-osu/src/models/mods.rs +++ b/youmubot-osu/src/models/mods.rs @@ -1,7 +1,7 @@ use serde::{Deserialize, Serialize}; use std::fmt; -const LAZER_TEXT: &'static str = "⚡"; +const LAZER_TEXT: &'static str = "v2"; bitflags::bitflags! { /// The mods available to osu! @@ -81,13 +81,13 @@ impl Mods { // Return the string length of the string representation of the mods. pub fn str_len(&self) -> usize { let s = format!("{}", self); - s.len() + if s.contains(LAZER_TEXT) { 1 } else { 0 } + s.len() } // Format the mods into a string with padded size. pub fn to_string_padded(&self, size: usize) -> String { let s = format!("{}", self); - let real_padded = size - if s.contains(LAZER_TEXT) { 1 } else { 0 }; + let real_padded = size; format!("{:>mw$}", s, mw = real_padded) } }