1
0
Fork 0
mirror of synced 2024-05-17 19:03:08 +12:00

Clippy also on generated code

This commit is contained in:
Rafał Mikrut 2023-10-29 21:11:07 +01:00
parent d367f33e40
commit 4ae23037e4
3 changed files with 28 additions and 13 deletions

View file

@ -35,13 +35,14 @@ fn handle_delete_empty_folders(app: &MainWindow) {
// TODO delete in parallel items, consider to add progress bar
fn remove_selected_items(items: Vec<MainListModel>) {
dbg!(format!("Items to remove {}", items.len()));
items.into_iter().for_each(|_item| {});
drop(items);
// items.into_iter().for_each(|_item| {});
}
fn deselect_all_items(items: &mut [MainListModel]) {
items.iter_mut().for_each(|item| {
for item in items {
item.selected_row = false;
});
}
}
fn filter_out_checked_items(items: &ModelRc<MainListModel>, have_header: bool) -> (Vec<MainListModel>, Vec<MainListModel>) {
@ -88,21 +89,23 @@ fn filter_out_checked_items(items: &ModelRc<MainListModel>, have_header: bool) -
// Function to verify if really headers are not checked
// Checked header is big bug
#[cfg(debug_assertions)]
fn check_if_header_is_checked(items: &ModelRc<MainListModel>) {
for item in items.iter() {
if item.header_row {
assert!(!item.checked);
if cfg!(debug_assertions) {
for item in items.iter() {
if item.header_row {
assert!(!item.checked);
}
}
}
}
// In some modes header should not be visible, but if are, then it is a bug
#[cfg(debug_assertions)]
fn check_if_header_is_selected_but_should_not_be(items: &ModelRc<MainListModel>, can_have_header: bool) {
if !can_have_header {
for item in items.iter() {
assert!(!item.header_row);
if cfg!(debug_assertions) {
if !can_have_header {
for item in items.iter() {
assert!(!item.header_row);
}
}
}
}

View file

@ -3,9 +3,9 @@ use crate::MainWindow;
pub fn connect_open_items(app: &MainWindow) {
app.on_item_opened(move |path| {
match open::that(&*path) {
Ok(_) => {}
Ok(()) => {}
Err(e) => {
eprintln!("Failed to open file: {}", e);
eprintln!("Failed to open file: {e}");
}
};
// TODO - this should be added to line edit

View file

@ -1,4 +1,16 @@
#![allow(clippy::comparison_chain)]
#![allow(clippy::collapsible_if)]
#![allow(clippy::overly_complex_bool_expr)] // Generated code
#![allow(clippy::semicolon_if_nothing_returned)] // Generated code
#![allow(clippy::used_underscore_binding)] // Generated code
#![allow(clippy::unreadable_literal)] // Generated code
#![allow(clippy::float_cmp)] // Generated code
#![allow(clippy::no_effect_underscore_binding)] // Generated code
#![allow(clippy::uninlined_format_args)] // Generated code
#![allow(clippy::needless_pass_by_value)] // Generated code
#![allow(clippy::redundant_closure_for_method_calls)] // Generated code
#![allow(clippy::items_after_statements)] // Generated code
#![allow(clippy::match_same_arms)] // Generated code
mod common;
mod connect_delete;