remove clone from states
This commit is contained in:
1 parent
f66bf69ef5
commit
ace54b10e1
8 files changed
-11
No files matched your search
@@ -11,10 +11,8 @@ use iced::widget::*;
|
||||
use iced::{Element, Fill, FillPortion, Task};
|
||||
use std::sync::Arc;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct HistoryState {
|
||||
list: Vec<(WordData, HistoryNote)>,
|
||||
pub state: AppState,
|
||||
}
|
||||
|
||||
impl NavigatedPage<HistoryMessage> for HistoryState {
|
||||
@@ -50,7 +48,6 @@ impl HistoryState {
|
||||
let dict = &state.dictionary.read();
|
||||
let history_repo = &mut state.history.write();
|
||||
history_repo.init().expect("TODO: panic message");
|
||||
let id = id;
|
||||
let mut history = history_repo.query(Arc::new(move |h| h.deck_id == id));
|
||||
let words = history
|
||||
.iter(history_repo)
|
||||
@@ -69,7 +66,6 @@ impl HistoryState {
|
||||
.collect();
|
||||
Self {
|
||||
list: words,
|
||||
state: state.clone(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,6 @@ use zip::ZipArchive;
|
||||
|
||||
const DEFAULT_FIELDS: [&str; 6] = ["key", "value", "tags", "reading", "context", "description"];
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct ImportState {
|
||||
state: AppState,
|
||||
path: Option<PathBuf>,
|
||||
|
||||
@@ -9,7 +9,6 @@ use iced::widget::*;
|
||||
use iced::{Element, Fill, Task, alignment};
|
||||
use rand::seq::SliceRandom;
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct QuizState {
|
||||
kana: String,
|
||||
current_roman: String,
|
||||
|
||||
@@ -7,7 +7,6 @@ use iced::Task;
|
||||
use iced::widget::text_editor;
|
||||
use rand::prelude::SliceRandom;
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct RandomizerState {
|
||||
text: text_editor::Content,
|
||||
list: Vec<String>,
|
||||
|
||||
@@ -31,7 +31,6 @@ use std::collections::BTreeMap;
|
||||
use std::ops::Deref;
|
||||
use std::sync::Arc;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct RepetitionsState {
|
||||
selected_deck_handle: Option<EntityHandle<DeckSettings>>,
|
||||
decks: BTreeMap<EntityHandle<DeckSettings>, DeckRunData>,
|
||||
|
||||
@@ -32,7 +32,6 @@ pub enum SyncMessage {
|
||||
DisableSync,
|
||||
SwitchAutoSync,
|
||||
}
|
||||
#[derive(Clone)]
|
||||
pub struct SyncState {
|
||||
state: AppState,
|
||||
auto_fetch: bool,
|
||||
|
||||
@@ -8,7 +8,6 @@ use iced::widget::button::danger;
|
||||
use iced::widget::{button, column, row, space, text, text_input};
|
||||
use iced::{Element, Fill, Task};
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct WordState {
|
||||
state: AppState,
|
||||
handle: EntityHandle<WordData>,
|
||||
|
||||
@@ -7,7 +7,6 @@ use iced::widget::*;
|
||||
use iced::{Element, Fill, Task, alignment};
|
||||
use rand::seq::SliceRandom;
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct WritingState {
|
||||
kana: String,
|
||||
set: Vec<(String, String)>,
|
||||
|
||||
Reference in new issue
Block a user