From f8cbd7ceb05c9920ec83b27dd707df06a07eccca Mon Sep 17 00:00:00 2001 From: Natsu Kagami Date: Fri, 12 Jun 2020 01:06:24 -0400 Subject: [PATCH] Implement conversion between mods --- youmubot-osu/src/models/mods.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/youmubot-osu/src/models/mods.rs b/youmubot-osu/src/models/mods.rs index 48dcc69..5a49984 100644 --- a/youmubot-osu/src/models/mods.rs +++ b/youmubot-osu/src/models/mods.rs @@ -128,3 +128,9 @@ impl fmt::Display for Mods { Ok(()) } } + +impl From for oppai_rs::Mods { + fn from(m: Mods) -> Self { + oppai_rs::Mods::from_bits_truncate(m.bits() as i32) + } +}