From 8e38dad6d035d2576da8192ba6ca3c8e4a7de660 Mon Sep 17 00:00:00 2001 From: leca Date: Tue, 2 Apr 2024 15:32:43 +0300 Subject: [PATCH] rustfmt --- src/game.rs | 4 ++-- src/labled_switch/imp.rs | 8 +++++--- src/labled_switch/mod.rs | 8 ++++++-- src/main.rs | 7 +++---- src/ui/cards/edit/imp.rs | 1 + src/ui/cards/game/imp.rs | 1 + 6 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/game.rs b/src/game.rs index f7fe3fa..4135cc9 100644 --- a/src/game.rs +++ b/src/game.rs @@ -103,7 +103,7 @@ const KATAKANA: KanaCharacters = [ ["サ", "シ", "ス", "セ", "ソ"], ["タ", "チ", "ツ", "テ", "ト"], ["ナ", "ニ", "ヌ", "ネ", "ノ"], - ["ハ", "ヒ", "フ", "ヘ", "ホ"], + ["ハ", "ヒ", "フ", "ヘ", "ホ"], ["マ", "ミ", "ム", "メ", "モ"], ["ヤ", OBS, "ユ", OBS, "ヨ"], ["ラ", "リ", "ル", "レ", "ロ"], @@ -199,4 +199,4 @@ pub fn generate_question_text(question: &Hieroglyph, exact_kana: &Kanas) -> Stri ) } }); -} \ No newline at end of file +} diff --git a/src/labled_switch/imp.rs b/src/labled_switch/imp.rs index eaa7b4f..f81af90 100644 --- a/src/labled_switch/imp.rs +++ b/src/labled_switch/imp.rs @@ -38,13 +38,15 @@ impl ObjectImpl for LabledSwitch { self.parent_constructed(); let l: &Label = self.label_obj.as_ref(); - self.obj().bind_property("label_text", l, "label").sync_create().build(); + self.obj() + .bind_property("label_text", l, "label") + .sync_create() + .build(); } fn dispose(&self) { self.dispose_template(); } - } -impl WidgetImpl for LabledSwitch { } \ No newline at end of file +impl WidgetImpl for LabledSwitch {} diff --git a/src/labled_switch/mod.rs b/src/labled_switch/mod.rs index e670f42..de2a5ab 100644 --- a/src/labled_switch/mod.rs +++ b/src/labled_switch/mod.rs @@ -1,7 +1,11 @@ mod imp; use glib::Object; -use gtk::{gio, glib::{self, subclass::types::ObjectSubclassIsExt}, Label, Switch}; +use gtk::{ + gio, + glib::{self, subclass::types::ObjectSubclassIsExt}, + Label, Switch, +}; glib::wrapper! { pub struct LabledSwitch(ObjectSubclass) @@ -21,4 +25,4 @@ impl LabledSwitch { pub fn get_label(&self) -> &Label { self.imp().label_obj.as_ref() } -} \ No newline at end of file +} diff --git a/src/main.rs b/src/main.rs index 4dbe396..f77844f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,14 +4,13 @@ mod ui; use crate::ui::menu::MenuScene; +use gtk::{gio, glib, Application}; use gtk::{prelude::*, ApplicationWindow}; -use gtk::{glib, Application, gio}; const APP_ID: &str = "org.foxarmy.learn-hieroglyph"; fn main() -> glib::ExitCode { - gio::resources_register_include!("compiled.gresource") - .expect("Cannot include gresources"); + gio::resources_register_include!("compiled.gresource").expect("Cannot include gresources"); let app: Application = Application::builder().application_id(APP_ID).build(); @@ -20,7 +19,7 @@ fn main() -> glib::ExitCode { app.run() } -fn test_ui (app: &Application) { +fn test_ui(app: &Application) { let window: ApplicationWindow = MenuScene::new(app).into(); window.present(); diff --git a/src/ui/cards/edit/imp.rs b/src/ui/cards/edit/imp.rs index e69de29..8b13789 100644 --- a/src/ui/cards/edit/imp.rs +++ b/src/ui/cards/edit/imp.rs @@ -0,0 +1 @@ + diff --git a/src/ui/cards/game/imp.rs b/src/ui/cards/game/imp.rs index e69de29..8b13789 100644 --- a/src/ui/cards/game/imp.rs +++ b/src/ui/cards/game/imp.rs @@ -0,0 +1 @@ +