Run cargo and clippy fix
This commit is contained in:
parent
7b931fb033
commit
7cce6409b7
@ -13,13 +13,13 @@ pub async fn load_and_validate_sheets(
|
||||
database: &Database,
|
||||
directory: impl AsRef<Path>,
|
||||
) -> Vec<Sheet> {
|
||||
let sheets = sheet_dao::fetch_all_sheets(&database).await.unwrap();
|
||||
let sheets = sheet_dao::fetch_all_sheets(database).await.unwrap();
|
||||
|
||||
debug!("Validating sheets from database...");
|
||||
let mut validation_result = validate_sheet_files(sheets, directory);
|
||||
debug!("{}", validation_result.get_stats()); // TODO: handle invalidated files
|
||||
for updated in validation_result.updated_sheets.iter() {
|
||||
sheet_dao::update_sheet_path(&database, updated)
|
||||
sheet_dao::update_sheet_path(database, updated)
|
||||
.await
|
||||
.unwrap();
|
||||
}
|
||||
@ -29,7 +29,7 @@ pub async fn load_and_validate_sheets(
|
||||
|
||||
debug!("Inserting unassigned files into orphan table...");
|
||||
for unassigned in validation_result.unassigned_files {
|
||||
let orphan = sheet_dao::insert_file_as_orphan(&database, unassigned)
|
||||
let orphan = sheet_dao::insert_file_as_orphan(database, unassigned)
|
||||
.await
|
||||
.unwrap();
|
||||
sheets.push(orphan);
|
||||
|
@ -1,7 +1,4 @@
|
||||
use std::{
|
||||
path::{Path, PathBuf},
|
||||
sync::Arc,
|
||||
};
|
||||
use std::{path::PathBuf, sync::Arc};
|
||||
|
||||
use chrono::Utc;
|
||||
use gtk::prelude::*;
|
||||
@ -13,7 +10,7 @@ use relm4::{
|
||||
};
|
||||
|
||||
use crate::{
|
||||
database::{self, Database},
|
||||
database::Database,
|
||||
sheet::{I64DateTime, Sheet},
|
||||
sheet_dao, sheet_validation,
|
||||
ui::mcdu::McduOutput,
|
||||
@ -168,9 +165,7 @@ impl AsyncComponent for AppModel {
|
||||
let db = Arc::clone(&self.database);
|
||||
let dir = Arc::clone(&self.directory);
|
||||
sender.oneshot_command(async move {
|
||||
let sheets =
|
||||
sheet_validation::load_and_validate_sheets(&db, dir.as_ref()).await;
|
||||
return sheets;
|
||||
sheet_validation::load_and_validate_sheets(&db, dir.as_ref()).await
|
||||
})
|
||||
}
|
||||
AppInput::Sort => self.sheets_listing.emit(SheetListingInput::Sort),
|
||||
|
@ -8,7 +8,7 @@ use crate::sheet::Sheet;
|
||||
|
||||
use super::sheet_model::{OnQueryUpdate, SheetModel};
|
||||
|
||||
use rand::{seq::SliceRandom, thread_rng};
|
||||
use rand::seq::SliceRandom;
|
||||
|
||||
pub struct SheetListingModel {
|
||||
sheets: FactoryVecDeque<SheetModel>,
|
||||
|
Loading…
x
Reference in New Issue
Block a user