[fractal/clippyfixes: 6/7] clippy: use of `unwrap_or` followed by a function call
- From: Alexandre Franke <afranke src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [fractal/clippyfixes: 6/7] clippy: use of `unwrap_or` followed by a function call
- Date: Fri, 23 Oct 2020 16:00:43 +0000 (UTC)
commit 846c893f3a6c96c39df9df46990dba4d28188a30
Author: Alexandre Franke <afranke gnome org>
Date: Fri Oct 23 17:51:47 2020 +0200
clippy: use of `unwrap_or` followed by a function call
https://rust-lang.github.io/rust-clippy/master/index.html#or_fun_call
fractal-gtk/src/widgets/login.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/fractal-gtk/src/widgets/login.rs b/fractal-gtk/src/widgets/login.rs
index 8757982f..a0e237a3 100644
--- a/fractal-gtk/src/widgets/login.rs
+++ b/fractal-gtk/src/widgets/login.rs
@@ -107,7 +107,7 @@ impl LoginWidget {
.as_ref()
.map(|ids| Url::parse(&ids.base_url))
.transpose()?
- .unwrap_or(globals::DEFAULT_IDENTITYSERVER.clone());
+ .unwrap_or_else(|| globals::DEFAULT_IDENTITYSERVER.clone());
info!("Got well-known response from {}: {:#?}", &txt, response);
Ok((hs_url, ids))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]