[fractal/bilelmoussaoui/bump-gtk-rs: 15/15] Use is_empty instead of != comparison
- From: Daniel Garcia Moreno <danigm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [fractal/bilelmoussaoui/bump-gtk-rs: 15/15] Use is_empty instead of != comparison
- Date: Fri, 21 Aug 2020 12:16:39 +0000 (UTC)
commit 8715d1209ef763caa5120a3e2a8f59525bf7440e
Author: Daniel GarcĂa Moreno <dani danigm net>
Date: Fri Aug 21 14:11:20 2020 +0200
Use is_empty instead of != comparison
Cargo.lock | 6 ------
fractal-gtk/src/app/connect/account.rs | 2 +-
fractal-gtk/src/appop/account.rs | 2 +-
3 files changed, 2 insertions(+), 8 deletions(-)
---
diff --git a/Cargo.lock b/Cargo.lock
index 0303b631..ca899b0e 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1807,12 +1807,6 @@ dependencies = [
"libc",
]
-[[package]]
-name = "object"
-version = "0.20.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1ab52be62400ca80aa00285d25253d7f7c437b7375c4de678f5405d3afe82ca5"
-
[[package]]
name = "once_cell"
version = "1.4.1"
diff --git a/fractal-gtk/src/app/connect/account.rs b/fractal-gtk/src/app/connect/account.rs
index 115a5345..83f81777 100644
--- a/fractal-gtk/src/app/connect/account.rs
+++ b/fractal-gtk/src/app/connect/account.rs
@@ -105,7 +105,7 @@ impl App {
let button = name_btn.clone();
name_entry.connect_property_text_notify(clone!(@strong op => move |w| {
let username = w.get_text();
- if username != "" && op.try_lock()
+ if !username.is_empty() && op.try_lock()
.ok()
.and_then(|guard| guard.login_data.clone())
.and_then(|login_data| login_data.username)
diff --git a/fractal-gtk/src/appop/account.rs b/fractal-gtk/src/appop/account.rs
index 37ab4292..23f5be35 100644
--- a/fractal-gtk/src/appop/account.rs
+++ b/fractal-gtk/src/appop/account.rs
@@ -677,7 +677,7 @@ impl AppOp {
let old = old_password.get_text();
let new = new_password.get_text();
- if old != ""&& new != "" {
+ if !old.is_empty() && !new.is_empty() {
password_btn.set_sensitive(false);
password_btn_stack.set_visible_child_name("spinner");
thread::spawn(move || {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]