code cleanup
This commit is contained in:
+5
-12
@@ -2,18 +2,18 @@
|
||||
mod data_provider;
|
||||
mod dictionary;
|
||||
mod dictionary_test;
|
||||
mod history;
|
||||
mod lang;
|
||||
pub mod navigation;
|
||||
mod quiz;
|
||||
mod randomizer;
|
||||
mod repetition;
|
||||
mod repetitions;
|
||||
mod selector;
|
||||
pub mod styling;
|
||||
mod sync;
|
||||
mod word;
|
||||
mod writing;
|
||||
mod history;
|
||||
pub mod navigation;
|
||||
pub mod styling;
|
||||
|
||||
use crate::data_provider::card_sets::load_sets;
|
||||
use crate::data_provider::settings::get_setting;
|
||||
@@ -28,15 +28,13 @@ use iced::Font;
|
||||
use iced::{keyboard, Program, Subscription, Theme};
|
||||
use rusqlite::Connection;
|
||||
|
||||
|
||||
const USER_FONT: Font = Font::with_name("Noto Sans JP");
|
||||
|
||||
fn main() -> iced::Result {
|
||||
|
||||
iced::application(ScreenState::boot, ScreenState::update, ScreenState::view)
|
||||
.subscription(subscription)
|
||||
.title("Kana learn app")
|
||||
.settings(iced::Settings{
|
||||
.settings(iced::Settings {
|
||||
default_text_size: iced::Pixels(18.0),
|
||||
..iced::Settings::default()
|
||||
})
|
||||
@@ -50,8 +48,6 @@ fn subscription(_state: &ScreenState) -> Subscription<RootMessage> {
|
||||
keyboard::listen().map(|e| Keyboard(e))
|
||||
}
|
||||
|
||||
|
||||
|
||||
pub struct AppState {
|
||||
pub dictionary: Vec<WordData>,
|
||||
pub card_sets: Vec<CardSetSettings>,
|
||||
@@ -67,7 +63,7 @@ impl AppState {
|
||||
let connection = Connection::open(db_file).unwrap();
|
||||
connection.execute("PRAGMA foreign_keys = ON;", []).unwrap();
|
||||
|
||||
Self{
|
||||
Self {
|
||||
dictionary: vec![],
|
||||
card_sets: vec![],
|
||||
word_groups: vec![],
|
||||
@@ -77,8 +73,6 @@ impl AppState {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
fn fill_state(state: &mut AppState) {
|
||||
let list = load_words(&state.connection);
|
||||
let sets = load_sets(&state.connection);
|
||||
@@ -95,4 +89,3 @@ fn load_settings(connection: &Connection) -> AppSettings {
|
||||
let key = get_setting("SYNC_KEY".to_string(), connection);
|
||||
AppSettings { key }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user