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)?;
|
let typ = msg_type_wrapper(msg)?;
|
||||||
match typ {
|
match typ {
|
||||||
NostrRawMessage::Event(_) => Err(Error::EventParseFailed),
|
NostrRawMessage::Event(_) => Err(Error::EventParseFailed),
|
||||||
NostrRawMessage::Req(m) => {
|
NostrRawMessage::Req(m) => Ok(NostrRequest::Subscription(request::Subscription::parse(
|
||||||
let s = request::Subscription::parse(&m)?;
|
&m,
|
||||||
Ok(NostrRequest::Subscription(s))
|
)?)),
|
||||||
}
|
|
||||||
NostrRawMessage::Close(_) => Err(Error::CloseParseFailed),
|
NostrRawMessage::Close(_) => Err(Error::CloseParseFailed),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user