[fractal/clippyfixes: 1/7] clippy: collapsible if
- From: Alexandre Franke <afranke src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [fractal/clippyfixes: 1/7] clippy: collapsible if
- Date: Fri, 23 Oct 2020 16:00:42 +0000 (UTC)
commit b0ed53044df9e0476a8b74cbba237c0871e910fb
Author: Alexandre Franke <afranke gnome org>
Date: Fri Oct 23 17:21:33 2020 +0200
clippy: collapsible if
https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if
fractal-gtk/src/actions/global.rs | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
---
diff --git a/fractal-gtk/src/actions/global.rs b/fractal-gtk/src/actions/global.rs
index 2db1ad22..41efc020 100644
--- a/fractal-gtk/src/actions/global.rs
+++ b/fractal-gtk/src/actions/global.rs
@@ -169,20 +169,16 @@ pub fn new(app: >k::Application, op: &Arc<Mutex<AppOp>>) {
let mut op = op.lock().unwrap();
if let Some(id) = op.roomlist.prev_id() {
op.set_active_room_by_id(id);
- } else {
- if let Some(last_room) = op.roomlist.last_id() {
- op.set_active_room_by_id(last_room);
- }
+ } else if let Some(last_room) = op.roomlist.last_id() {
+ op.set_active_room_by_id(last_room);
}
}));
next_room.connect_activate(clone!(@strong op => move |_, _| {
let mut op = op.lock().unwrap();
if let Some(id) = op.roomlist.next_id() {
op.set_active_room_by_id(id);
- } else {
- if let Some(first_room) = op.roomlist.first_id() {
- op.set_active_room_by_id(first_room);
- }
+ } else if let Some(first_room) = op.roomlist.first_id() {
+ op.set_active_room_by_id(first_room);
}
}));
prev_unread_room.connect_activate(clone!(@strong op => move |_, _| {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]