Clippy code cleanup
This commit is contained in:
1 parent
9917702c4c
commit
e676898135
22 files changed
+290
-171
No files matched your search
@@ -50,16 +50,14 @@ pub fn add_words(words: &mut[WordData], connection: &mut Connection) {
|
||||
|
||||
let start_index = last_index - (count as u32) + 1;
|
||||
|
||||
let mut index = 0;
|
||||
for id in start_index..=last_index {
|
||||
for (index, id) in (start_index..=last_index).enumerate() {
|
||||
words[index].id = id;
|
||||
index += 1;
|
||||
}
|
||||
}
|
||||
|
||||
pub fn update_word(word: &mut WordData, connection: &Connection) {
|
||||
if word.id == 0 {
|
||||
add_word(word, &connection);
|
||||
add_word(word, connection);
|
||||
} else {
|
||||
connection
|
||||
.execute(
|
||||
@@ -155,7 +153,7 @@ pub fn add_group(group: &mut WordGroup, connection: &Connection) {
|
||||
|
||||
pub fn update_group(group: &mut WordGroup, connection: &Connection) {
|
||||
if group.id == 0 {
|
||||
add_group(group, &connection);
|
||||
add_group(group, connection);
|
||||
} else {
|
||||
connection
|
||||
.execute(
|
||||
|
||||
Reference in new issue
Block a user