aboutsummaryrefslogtreecommitdiff
path: root/src/manager/builder.rs
diff options
context:
space:
mode:
authorHristo Venev <hristo@venev.name>2019-09-28 18:20:33 +0000
committerHristo Venev <hristo@venev.name>2019-09-29 16:11:35 +0300
commit56d37f135536c7d17ab98c6671094925dee64a5e (patch)
tree652b972cef0c1700b4c8ee457afd7b79861f1672 /src/manager/builder.rs
parent8e6318f29eb022126e82e0c084262c77d9ee3300 (diff)
I don't like `if let` that much.
Diffstat (limited to 'src/manager/builder.rs')
-rw-r--r--src/manager/builder.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/manager/builder.rs b/src/manager/builder.rs
index e5fe2da..a5f04f2 100644
--- a/src/manager/builder.rs
+++ b/src/manager/builder.rs
@@ -162,11 +162,9 @@ fn find_psk<'a>(
src: &'a Source,
p: &proto::Peer,
) -> Result<Option<&'a model::Key>, Error> {
- let want = gc.peers.get(&p.public_key);
- let want = if let Some(v) = want {
- v
- } else {
- return Ok(None);
+ let want = match gc.peers.get(&p.public_key) {
+ Some(v) => v,
+ None => return Ok(None),
};
if let Some(ref want_src) = &want.source {