Skip to content

Commit dd33c70

Browse files
authored
GuestMemorySliceIterator: clarify error case for .stop_on_error()
1 parent e70475c commit dd33c70

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/guest_memory.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,7 @@ impl<'a, M: GuestMemory + ?Sized> GuestMemorySliceIterator<'a, M> {
539539

540540
/// Adapts this [`GuestMemorySliceIterator`] to return `None` (e.g. gracefully terminate)
541541
/// when if encounters an error after successfully producing at least one slice.
542+
/// Return an error if requesting the first slice returns an error.
542543
pub fn stop_on_error(self) -> Result<impl Iterator<Item = VolatileSlice<'a, MS<'a, M>>>> {
543544
let mut peek = self.peekable();
544545
if let Some(err) = peek.next_if(Result::is_err) {

0 commit comments

Comments
 (0)