diff --git a/doc/rust.texi b/doc/rust.texi index e7bbb01d25a..6ba9d618146 100644 --- a/doc/rust.texi +++ b/doc/rust.texi @@ -1845,7 +1845,7 @@ iter range(int lo, int hi) -> int @{ @} let int sum = 0; -for each (int x = range(0,100)) @{ +for each (int x in range(0,100)) @{ sum += x; @} @end example @@ -2325,7 +2325,7 @@ iter range(int x, int y) -> int @{ @} @} -for each (int i = range(5,7)) @{ +for each (int i in range(5,7)) @{ @dots{}; @} @end example @@ -3149,7 +3149,7 @@ fn read_file_lines(&str path) -> vec[str] @{ note path; vec[str] r; file f = open_read(path); - for each (str &s = lines(f)) @{ + for each (str &s in lines(f)) @{ vec.append(r,s); @} ret r; @@ -3282,7 +3282,7 @@ Example of a foreach loop: @example let str txt; let vec[str] lines; -for each (&str s = _str.split(txt, "\n")) @{ +for each (&str s in _str.split(txt, "\n")) @{ vec.push(lines, s); @} @end example