radicle/node: Announcements only have one result

For commands that may return multiple responses, a loop makes sense,
but inventory announcements should expect exactly one response.
This commit is contained in:
Lorenz Leutgeb
2026-10-23 20:15:11 +02:00
parent 15e2d7d455
commit 949bf9c72e
+3 -3
View File
@@ -1413,9 +1413,9 @@ impl Handle for Node {
}
fn announce_inventory(&mut self) -> Result<(), Error> {
for line in self.call::<Success>(Command::AnnounceInventory, DEFAULT_TIMEOUT)? {
line?;
}
self.call::<Success>(Command::AnnounceInventory, DEFAULT_TIMEOUT)?
.next()
.ok_or(Error::EmptyResponse)??;
Ok(())
}