Formatting
This commit is contained in:
1 parent
dddac01bdf
commit
10cf7f0d2e
29 files changed
+138
-138
No files matched your search
+10
-9
@@ -1,10 +1,13 @@
|
||||
use crate::app::AppState;
|
||||
use crate::data::entities::{WordData, WordGroup};
|
||||
use crate::data_provider::import::{ImportData, ImportGroup, get_words_of_group, load_groups};
|
||||
use crate::data_provider::words::{add_group, add_words};
|
||||
use crate::pages::import::ImportMessage::*;
|
||||
use crate::data::entities::{WordData, WordGroup};
|
||||
use crate::fs::*;
|
||||
use crate::navigation::{NavigatedPage, Page, RootMessage};
|
||||
use crate::notification::NotificationData::OpenFileError;
|
||||
use crate::notification::{MaybeError, NotificationData};
|
||||
use crate::pages::import::ImportMessage::*;
|
||||
use crate::push_error;
|
||||
use crate::styling::*;
|
||||
use iced::widget::button::danger;
|
||||
use iced::widget::container::success;
|
||||
@@ -16,6 +19,7 @@ use iced::{Element, Task};
|
||||
use iced_core::Alignment::Center;
|
||||
use iced_core::Length::Fill;
|
||||
use iced_core::Padding;
|
||||
use log::info;
|
||||
use parking_lot::Mutex;
|
||||
use rfd::AsyncFileDialog;
|
||||
use rusqlite::Connection;
|
||||
@@ -23,12 +27,8 @@ use std::fs::{File, OpenOptions};
|
||||
use std::io::BufReader;
|
||||
use std::path::PathBuf;
|
||||
use std::sync::Arc;
|
||||
use log::info;
|
||||
use tokio::task::spawn_blocking;
|
||||
use zip::ZipArchive;
|
||||
use crate::app::AppState;
|
||||
use crate::fs::*;
|
||||
use crate::push_error;
|
||||
|
||||
const DEFAULT_FIELDS: [&str; 6] = ["key", "value", "tags", "reading", "context", "description"];
|
||||
|
||||
@@ -433,7 +433,8 @@ impl ImportState {
|
||||
async move {
|
||||
spawn_blocking(move || {
|
||||
let temp_file_path = temp_import_path();
|
||||
let connection = Connection::open(&temp_file_path).map_err(|_| OpenFileError)?;
|
||||
let connection =
|
||||
Connection::open(&temp_file_path).map_err(|_| OpenFileError)?;
|
||||
let import_list = get_words_of_group(&connection, group.id)?;
|
||||
let mut words_list = Vec::with_capacity(import_list.len());
|
||||
|
||||
@@ -500,8 +501,8 @@ impl ImportState {
|
||||
},
|
||||
|r: Result<(), NotificationData>| match r {
|
||||
Ok(_) => RootMessage::Import(ImportFinished),
|
||||
Err(err) => push_error!(err)
|
||||
}
|
||||
Err(err) => push_error!(err),
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user