tls13: fix clippy::unnecessary_lazy_evaluations finding

```
error: unnecessary closure used with `bool::then`
  --> rustls/src/tls13/mod.rs:87:9
   |
87 |         (prev.hash_algorithm() == self.hash_algorithm()).then(|| prev)
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-------------
   |                                                          |
   |                                                          help: use `then_some(..)` instead: `then_some(prev)`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations
   = note: `-D clippy::unnecessary-lazy-evaluations` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::unnecessary_lazy_evaluations)]`

```
This commit is contained in:
Daniel McCarney 2024-04-26 10:22:47 -04:00
parent 6da53375a2
commit 6fd691a101
1 changed files with 1 additions and 1 deletions

View File

@ -84,7 +84,7 @@ impl Tls13CipherSuite {
/// Can a session using suite self resume from suite prev?
pub fn can_resume_from(&self, prev: &'static Self) -> Option<&'static Self> {
(prev.hash_algorithm() == self.hash_algorithm()).then(|| prev)
(prev.hash_algorithm() == self.hash_algorithm()).then_some(prev)
}
}