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()))`
pull/12/head
Sebastian Dröge 4 years ago
parent 42d6771357
commit a65c53b6cd
  1. 2
      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()))
}

Loading…
Cancel
Save