mirror of
https://github.com/scsibug/nostr-rs-relay.git
synced 2024-11-14 15:09:07 -05:00
Simplify request message parsing
This commit is contained in:
parent
4e2ec93584
commit
0b7742cfb1
|
@ -61,10 +61,9 @@ pub fn parse_type(msg: String) -> Result<NostrRequest> {
|
|||
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),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user