Fix doc references to 'for each' syntax to match the compiler.
The rustboot compiler expects 'for each (type v in ...)' like 'for', rather than 'for each (type v = ...)' as given in the documentation.
This commit is contained in:
parent
4af0db4d76
commit
446932b5bc
1 changed files with 4 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue