Skip to content

Commit

Permalink
Fix clippy warning about ok_or() followed by a function call
Browse files Browse the repository at this point in the history
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()))`
  • Loading branch information
sdroege committed Feb 4, 2020
1 parent 42d6771 commit a65c53b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
}

0 comments on commit a65c53b

Please sign in to comment.