Cleanup
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
use std::collections::HashMap;
|
||||
use iced::time::now;
|
||||
use rusqlite::Connection;
|
||||
use crate::lang::{CardSet, DictionaryElement};
|
||||
use crate::repetitions::CardSetSettings;
|
||||
use rusqlite::Connection;
|
||||
|
||||
pub fn load_sets(connection: &Connection) -> Vec<CardSetSettings> {
|
||||
let mut stmt = connection.prepare("SELECT id, name, forward, backward, filter FROM card_set").unwrap();
|
||||
|
||||
@@ -2,6 +2,3 @@ pub(crate) mod words;
|
||||
pub(crate) mod card_sets;
|
||||
pub(crate) mod card_stats;
|
||||
|
||||
use crate::lang;
|
||||
use crate::dictionary;
|
||||
|
||||
|
||||
@@ -142,10 +142,8 @@ fn create_card_set_table(conn: &Connection) {
|
||||
)",
|
||||
(),
|
||||
)
|
||||
.unwrap_or_else(|e| {
|
||||
println!("{}", e);
|
||||
0
|
||||
});
|
||||
}
|
||||
|
||||
pub struct Qwerty {}
|
||||
.unwrap_or_else(|e| {
|
||||
println!("{}", e);
|
||||
0
|
||||
});
|
||||
}
|
||||
@@ -355,16 +355,6 @@ pub fn split_with_coma(ts: String) -> Vec<String> {
|
||||
.collect::<Vec<String>>()
|
||||
}
|
||||
|
||||
pub fn dict_file() -> PathBuf {
|
||||
let mut dir = dirs::data_dir().unwrap();
|
||||
dir.push("jap_learn");
|
||||
if !dir.exists() {
|
||||
fs::create_dir(dir.clone()).unwrap();
|
||||
}
|
||||
dir.push("dict.json");
|
||||
dir
|
||||
}
|
||||
|
||||
pub fn app_data_dir() -> PathBuf {
|
||||
let mut dir = dirs::data_dir().unwrap();
|
||||
dir.push("jap_learn");
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ use crate::Page::{
|
||||
Dictionary, DictionaryQuiz, Quiz, Randomizer, Repetition, Repetitions, Selector, Writing,
|
||||
};
|
||||
use iced::widget::text;
|
||||
use iced::{keyboard, Element, Program, Subscription};
|
||||
use iced::{keyboard, Element, Subscription};
|
||||
use iced::{Font, Task};
|
||||
use rusqlite::Connection;
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
@@ -8,7 +8,6 @@ use iced::widget::container::rounded_box;
|
||||
use iced::widget::space::vertical;
|
||||
use iced::widget::{button, column, container, row, space, text};
|
||||
use iced::{alignment, keyboard, Element, Fill, Left, Task};
|
||||
use rusqlite::fallible_iterator::FallibleIterator;
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
pub struct RepetitionState {
|
||||
|
||||
Reference in New Issue
Block a user