Skip to content

Commit a583058

Browse files
committed
pool: remove Error::OneShotRecvError variant
Signed-off-by: Yuki Kishimoto <[email protected]>
1 parent bf17baf commit a583058

File tree

3 files changed

+3
-11
lines changed

3 files changed

+3
-11
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@
145145
* database: remove `Order` enum ([Yuki Kishimoto])
146146
* database: remove `order` arg from `NostrDatabase::query` ([Yuki Kishimoto])
147147
* pool: remove high latency log ([Yuki Kishimoto])
148+
* pool: remove `Error::OneShotRecvError` variant ([Yuki Kishimoto])
148149
* zapper: remove `Err` from `NostrZapper` and unnecessary variants from `ZapperError` ([Yuki Kishimoto])
149150
* js(nostr): remove `Keys::vanity` ([Yuki Kishimoto])
150151
* cli: remove `reverse` flag from `query` command

crates/nostr-relay-pool/src/relay/error.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,6 @@ pub enum Error {
7777
/// Batch event empty
7878
#[error("batch event cannot be empty")]
7979
BatchEventEmpty,
80-
/// Impossible to receive oneshot message
81-
#[error("impossible to recv msg")]
82-
OneShotRecvError,
8380
/// Read actions disabled
8481
#[error("read actions are disabled for this relay")]
8582
ReadDisabled,

crates/nostr-relay-pool/src/relay/internal.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,14 +1085,8 @@ impl InternalRelay {
10851085
// Wait for oneshot reply
10861086
match time::timeout(Some(opts.timeout), rx).await {
10871087
Some(result) => match result {
1088-
Ok(val) => {
1089-
if val {
1090-
Ok(())
1091-
} else {
1092-
Err(Error::MessageNotSent)
1093-
}
1094-
}
1095-
Err(_) => Err(Error::OneShotRecvError),
1088+
Ok(true) => Ok(()),
1089+
Ok(false) | Err(_) => Err(Error::MessageNotSent),
10961090
},
10971091
None => Err(Error::RecvTimeout),
10981092
}

0 commit comments

Comments
 (0)