From 500e76fff8ffdc6e4479456f80f658d3da218342 Mon Sep 17 00:00:00 2001 From: Sergey Melnychuk <8093171+sergey-melnychuk@users.noreply.github.com> Date: Thu, 28 Mar 2024 15:44:11 +0100 Subject: [PATCH] chore: minor cleanup of `parse_request` --- node/src/p2p/header_ex/server.rs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/node/src/p2p/header_ex/server.rs b/node/src/p2p/header_ex/server.rs index 191b9f74..1ca72243 100644 --- a/node/src/p2p/header_ex/server.rs +++ b/node/src/p2p/header_ex/server.rs @@ -191,15 +191,7 @@ fn parse_request(request: HeaderRequest) -> Option<(u64, header_request::Data)> return None; } - let HeaderRequest { - amount, - data: Some(data), - } = request - else { - return None; - }; - - Some((amount, data)) + request.data.map(|data| (request.amount, data)) } #[cfg(test)]