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