some formatting

This commit is contained in:
leca 2024-03-13 01:05:02 +03:00
parent d65978c891
commit a42744434d
1 changed files with 21 additions and 21 deletions

View File

@ -5,6 +5,7 @@ pub enum Kanas {
Hiragana, Hiragana,
Katakana Katakana
} }
pub struct Hieroglyph {syllable: String, row: usize, column: usize} pub struct Hieroglyph {syllable: String, row: usize, column: usize}
impl std::fmt::Display for Hieroglyph { impl std::fmt::Display for Hieroglyph {
@ -85,13 +86,12 @@ pub fn generate_random_hieroglyph(k: Kanas) -> Hieroglyph {
let row: usize = rand::thread_rng().gen_range(0..ROMAJI.len()-1); let row: usize = rand::thread_rng().gen_range(0..ROMAJI.len()-1);
let column: usize = rand::thread_rng().gen_range(0..ROMAJI[0].len()-1); let column: usize = rand::thread_rng().gen_range(0..ROMAJI[0].len()-1);
let generated: String = { let generated: String = match k {
match k {
Kanas::Romaji => ROMAJI[row][column].to_string(), Kanas::Romaji => ROMAJI[row][column].to_string(),
Kanas::Hiragana => HIRAGANA[row][column].to_string(), Kanas::Hiragana => HIRAGANA[row][column].to_string(),
Kanas::Katakana => KATAKANA[row][column].to_string() Kanas::Katakana => KATAKANA[row][column].to_string()
}
}; };
if generated == "0" { if generated == "0" {
return generate_random_hieroglyph(k); return generate_random_hieroglyph(k);
} }