[fractal/clippyfixes: 6/7] clippy: use of `unwrap_or` followed by a function call




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]