Fix clippy lints
This commit is contained in:
1 parent
0287561e2f
commit
17f7690789
2 files changed
+7
-10
No files matched your search
+4
-6
@@ -80,7 +80,7 @@ fn refresh_list(conf: &Arc<Mutex<Config>>, app_weak: &slint::Weak<App>) {
|
||||
let _ = app_weak.upgrade_in_event_loop(|app| {
|
||||
let list: ModelRc<SItem> = app.global::<State>().get_list();
|
||||
let list: &VecModel<SItem> = list.as_any().downcast_ref().expect("list is a VecModel");
|
||||
update_slint_list(new_list, &list);
|
||||
update_slint_list(new_list, list);
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -125,7 +125,7 @@ pub fn run() -> Result<(), anyhow::Error> {
|
||||
state.on_add_to_list(move |item| {
|
||||
if let Some(index) = list.iter().position(|item2| item2.name == item) {
|
||||
let mut item2 = list.row_data(index).unwrap();
|
||||
item2.amount = item2.amount + 1;
|
||||
item2.amount += 1;
|
||||
let item3 = item2.clone();
|
||||
list.set_row_data(index, item2);
|
||||
let conf = conf.clone();
|
||||
@@ -229,7 +229,7 @@ pub fn run() -> Result<(), anyhow::Error> {
|
||||
state.on_inc_amount(move |item| {
|
||||
if let Some(index) = list.iter().position(|item2| item2.name == item) {
|
||||
let mut item2 = list.row_data(index).unwrap();
|
||||
item2.amount = item2.amount + 1;
|
||||
item2.amount += 1;
|
||||
let item3 = item2.clone();
|
||||
list.set_row_data(index, item2);
|
||||
let conf = conf.clone();
|
||||
@@ -247,7 +247,6 @@ pub fn run() -> Result<(), anyhow::Error> {
|
||||
eprintln!("{err:?}");
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -256,7 +255,7 @@ pub fn run() -> Result<(), anyhow::Error> {
|
||||
state.on_dec_amount(move |item| {
|
||||
if let Some(index) = list.iter().position(|item2| item2.name == item) {
|
||||
let mut item2 = list.row_data(index).unwrap();
|
||||
item2.amount = item2.amount - 1;
|
||||
item2.amount -= 1;
|
||||
let item3 = item2.clone();
|
||||
list.set_row_data(index, item2);
|
||||
let conf = conf.clone();
|
||||
@@ -284,7 +283,6 @@ pub fn run() -> Result<(), anyhow::Error> {
|
||||
eprintln!("{err:?}");
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user