I would like to see a small documentation improvement on AddProgress::stream() (which currently has no documentation itself: https://docs.rs/iroh-blobs/latest/iroh_blobs/api/blobs/struct.AddProgress.html#method.stream)).
From the docs of (AddProgressItem)[https://docs.rs/iroh-blobs/latest/iroh_blobs/api/blobs/enum.AddProgressItem.html] it seems to me that the stream is always guaranteed to yield at least one element.
That should (IMHO) be stated on the AddProgress::stream() method. Using code like
loop {
let Some(next_item) = stream.next().await else { unreachable!() };
// processing the item and breaking the loop in case of a known-to-be-last-element item
}
would be possible (the bit with the unreachable!()). Otherwise I would need to handle the stream.next() -> None situation.
Please consider adding approriate documentation to AddProgress::stream()
I would like to see a small documentation improvement on
AddProgress::stream()(which currently has no documentation itself: https://docs.rs/iroh-blobs/latest/iroh_blobs/api/blobs/struct.AddProgress.html#method.stream)).From the docs of (AddProgressItem)[https://docs.rs/iroh-blobs/latest/iroh_blobs/api/blobs/enum.AddProgressItem.html] it seems to me that the stream is always guaranteed to yield at least one element.
That should (IMHO) be stated on the
AddProgress::stream()method. Using code likewould be possible (the bit with the
unreachable!()). Otherwise I would need to handle thestream.next() -> Nonesituation.Please consider adding approriate documentation to
AddProgress::stream()