From a65c53b6cd5ca94313325a67c698f9d9e229ab2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 4 Feb 2020 09:59:38 +0200 Subject: [PATCH] Fix clippy warning about ok_or() followed by a function call warning: use of `ok_or` followed by a function call --> src/lib.rs:379:10 | 379 | .ok_or(tungstenite::Error::Url("Url scheme not supported".into())) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `ok_or_else(|| tungstenite::Error::Url("Url scheme not supported".into()))` --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index e62a18e..60dc335 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -376,5 +376,5 @@ pub(crate) fn port( Some("ws") => Some(80), _ => None, }) - .ok_or(tungstenite::Error::Url("Url scheme not supported".into())) + .ok_or_else(|| tungstenite::Error::Url("Url scheme not supported".into())) }