Skip to content

Commit

Permalink
Fix type discrepancy in Language enum from upstream libctru
Browse files Browse the repository at this point in the history
  • Loading branch information
DeltaF1 committed Nov 8, 2024
1 parent 4a15ec9 commit 8aaaa6c
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions ctru-rs/src/services/cfgu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,29 +32,29 @@ pub enum Region {
#[repr(u8)]
pub enum Language {
/// Japanese.
Japanese = ctru_sys::CFG_LANGUAGE_JP,
Japanese = (ctru_sys::CFG_LANGUAGE_JP as u8),
/// English.
English = ctru_sys::CFG_LANGUAGE_EN,
English = (ctru_sys::CFG_LANGUAGE_EN as u8),
/// French.
French = ctru_sys::CFG_LANGUAGE_FR,
French = (ctru_sys::CFG_LANGUAGE_FR as u8),
/// German.
German = ctru_sys::CFG_LANGUAGE_DE,
German = (ctru_sys::CFG_LANGUAGE_DE as u8),
/// Italian.
Italian = ctru_sys::CFG_LANGUAGE_IT,
Italian = (ctru_sys::CFG_LANGUAGE_IT as u8),
/// Spanish.
Spanish = ctru_sys::CFG_LANGUAGE_ES,
Spanish = (ctru_sys::CFG_LANGUAGE_ES as u8),
/// Korean.
Korean = ctru_sys::CFG_LANGUAGE_KO,
Korean = (ctru_sys::CFG_LANGUAGE_KO as u8),
/// Dutch.
Dutch = ctru_sys::CFG_LANGUAGE_NL,
Dutch = (ctru_sys::CFG_LANGUAGE_NL as u8),
/// Portuguese.
Portuguese = ctru_sys::CFG_LANGUAGE_PT,
Portuguese = (ctru_sys::CFG_LANGUAGE_PT as u8),
/// Russian.
Russian = ctru_sys::CFG_LANGUAGE_RU,
Russian = (ctru_sys::CFG_LANGUAGE_RU as u8),
/// Simplified Chinese.
SimplifiedChinese = ctru_sys::CFG_LANGUAGE_ZH,
SimplifiedChinese = (ctru_sys::CFG_LANGUAGE_ZH as u8),
/// Traditional Chinese.
TraditionalChinese = ctru_sys::CFG_LANGUAGE_TW,
TraditionalChinese = (ctru_sys::CFG_LANGUAGE_TW as u8),
}

/// Specific model of the console.
Expand Down Expand Up @@ -268,7 +268,7 @@ impl TryFrom<u8> for Language {
type Error = ();

fn try_from(value: u8) -> Result<Self, Self::Error> {
match value {
match value as i8 {
ctru_sys::CFG_LANGUAGE_JP => Ok(Language::Japanese),
ctru_sys::CFG_LANGUAGE_EN => Ok(Language::English),
ctru_sys::CFG_LANGUAGE_FR => Ok(Language::French),
Expand Down

0 comments on commit 8aaaa6c

Please sign in to comment.