Skip to content

Commit 97aba0b

Browse files
committed
Adding more documentation to vec::each and vec::eachi to better explain the breaking protocol.
1 parent d899c3a commit 97aba0b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/libcore/vec.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -820,6 +820,8 @@ fn iter_between<T>(v: [const T], start: uint, end: uint, f: fn(T)) {
820820

821821
#[doc = "
822822
Iterates over a vector, with option to break
823+
824+
Return true to continue, false to break.
823825
"]
824826
#[inline(always)]
825827
fn each<T>(v: [const T]/&, f: fn(T) -> bool) unsafe {
@@ -836,6 +838,8 @@ fn each<T>(v: [const T]/&, f: fn(T) -> bool) unsafe {
836838

837839
#[doc = "
838840
Iterates over a vector's elements and indices
841+
842+
Return true to continue, false to break.
839843
"]
840844
#[inline(always)]
841845
fn eachi<T>(v: [const T]/&, f: fn(uint, T) -> bool) unsafe {

0 commit comments

Comments
 (0)