From 0b7742cfb1bab1fe5aa8856f234b71449f3a01ab Mon Sep 17 00:00:00 2001 From: Greg Heartsfield Date: Wed, 24 Nov 2021 14:24:35 -0600 Subject: [PATCH] Simplify request message parsing --- src/proto.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/proto.rs b/src/proto.rs index 62488e8..08f59ff 100644 --- a/src/proto.rs +++ b/src/proto.rs @@ -61,10 +61,9 @@ pub fn parse_type(msg: String) -> Result { let typ = msg_type_wrapper(msg)?; match typ { NostrRawMessage::Event(_) => Err(Error::EventParseFailed), - NostrRawMessage::Req(m) => { - let s = request::Subscription::parse(&m)?; - Ok(NostrRequest::Subscription(s)) - } + NostrRawMessage::Req(m) => Ok(NostrRequest::Subscription(request::Subscription::parse( + &m, + )?)), NostrRawMessage::Close(_) => Err(Error::CloseParseFailed), } }