Skip to content

Commit 9b78802

Browse files
committed
rs: improve docs of DisasmIter::next
1 parent 8eb76db commit 9b78802

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

capstone-rs/src/capstone.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,9 @@ impl<'cs, 'buf> DisasmIter<'cs, 'buf> {
677677
/// let mut iter = cs.disasm_iter(code, 0x1000).unwrap();
678678
/// let insn1 = iter.next().unwrap();
679679
/// let insn2 = iter.next().unwrap();
680-
/// // fails with: cannot borrow `iter` as mutable more than once at a time
680+
/// // fails with: cannot borrow `iter` as mutable more than once at a time,
681+
/// // `insn1` cannot be used after calling `iter.next()` again,
682+
/// // as `iter` is mutably borrowed during the second call to `next()`.
681683
/// println!("{insn1}");
682684
/// ```
683685
pub fn next<'iter>(&'iter mut self) -> Option<Insn<'iter>> {

0 commit comments

Comments
 (0)