Formating with fmt

This commit is contained in:
micialware committed 2026-08-19 23:51:41 +03:00
1 parent de2dbaf6c1
commit bf805b79e5
13 files changed
+44 -42

No files matched your search

+4 -3
View File
@@ -1,5 +1,5 @@
use crate::lang::{CardStatistics, DeckSettings};
use rusqlite::{params, Connection};
use rusqlite::{Connection, params};
use std::time::Instant;
pub fn load_stats_of_deck(set: &DeckSettings, connection: &Connection) -> Vec<CardStatistics> {
@@ -45,7 +45,7 @@ pub fn add_stat_list(stats: &mut [CardStatistics], connection: &mut Connection)
stat.score,
stat.last_open.timestamp()
])
.unwrap();
.unwrap();
}
}
@@ -78,5 +78,6 @@ pub fn delete_stat(stat: &CardStatistics, connection: &Connection) {
return;
}
connection
.execute("DELETE FROM card_stats WHERE id = ?1", (&stat.id,)).unwrap();
.execute("DELETE FROM card_stats WHERE id = ?1", (&stat.id,))
.unwrap();
}
+1 -1
View File
@@ -31,7 +31,7 @@ fn parse_history_items(strings: Vec<String>) -> Vec<HistoryItem> {
for string in strings {
if let [time, word, mode, before, after] = string.split(';').collect::<Vec<&str>>()[..] {
let id = word.parse::<Id>();
if id.is_err(){
if id.is_err() {
continue;
}
let id = id.unwrap();
+2 -3
View File
@@ -1,5 +1,5 @@
use crate::lang::{WordData, WordGroup};
use rusqlite::{params, Connection};
use rusqlite::{Connection, params};
use std::collections::HashMap;
pub fn add_word(word: &mut WordData, connection: &Connection) {
@@ -45,7 +45,6 @@ pub fn add_words(words: &mut [WordData], connection: &mut Connection) {
let last_index: u32 = tx.last_insert_rowid() as u32;
tx.commit().unwrap();
let start_index = last_index - (count as u32) + 1;
for (index, id) in (start_index..=last_index).enumerate() {
@@ -129,7 +128,7 @@ pub fn load_word_groups(connection: &Connection) -> Vec<WordGroup> {
}
pub fn add_group(group: &mut WordGroup, connection: &Connection) {
let index : u32 = connection
let index: u32 = connection
.query_row(
"INSERT INTO word_group (name) VALUES (?1) RETURNING id",
(&group.name,),