diff options
| author | Ralph Giles <[email protected]> | 2010-11-03 13:55:58 -0700 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2010-11-03 15:37:55 -0700 |
| commit | 446932b5bc1d95c556942a4f0b9c5a0325627108 (patch) | |
| tree | dd05d9815ea978b071f0efa4c066697ac1aa4d2a /doc | |
| parent | Make version.texi depend on rust.texi. (diff) | |
| download | rust-446932b5bc1d95c556942a4f0b9c5a0325627108.tar.xz rust-446932b5bc1d95c556942a4f0b9c5a0325627108.zip | |
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.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/rust.texi | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/doc/rust.texi b/doc/rust.texi index e7bbb01d..6ba9d618 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 |