From a20b071a8a0dd311d40c2a08d9b2465c30ce84d3 Mon Sep 17 00:00:00 2001 From: strawberry Date: Mon, 1 Apr 2024 23:30:57 -0400 Subject: [PATCH] add manual_let_else lint Signed-off-by: strawberry --- Cargo.toml | 1 + src/service/sending/appservice.rs | 7 ++----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 1222c894..119f654e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -525,6 +525,7 @@ single_match = "warn" single_match_else = "warn" explicit_deref_methods = "warn" explicit_iter_loop = "warn" +manual_let_else = "warn" # some sadness missing_errors_doc = "allow" diff --git a/src/service/sending/appservice.rs b/src/service/sending/appservice.rs index f751aa99..fc7e37fc 100644 --- a/src/service/sending/appservice.rs +++ b/src/service/sending/appservice.rs @@ -14,11 +14,8 @@ pub(crate) async fn send_request(registration: Registration, request: T) -> R where T: OutgoingRequest + Debug, { - let destination = match registration.url { - Some(url) => url, - None => { - return Ok(None); - }, + let Some(destination) = registration.url else { + return Ok(None); }; let hs_token = registration.hs_token.as_str();