diff options
| author | Sean Stangl <[email protected]> | 2011-01-27 02:48:54 -0500 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2011-01-27 12:15:54 -0800 |
| commit | 333924325463da96b54ac8b4b339a77c4f895eb7 (patch) | |
| tree | 528e63e408255d948e5e31441b9fbaa817b0fbef /doc | |
| parent | Correctly split a.b.c into its path and field access components. (diff) | |
| download | rust-333924325463da96b54ac8b4b339a77c4f895eb7.tar.xz rust-333924325463da96b54ac8b4b339a77c4f895eb7.zip | |
Fix documentation: aliases may not be used in loop constructs.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/rust.texi | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/doc/rust.texi b/doc/rust.texi index 11e8c907..adf84a12 100644 --- a/doc/rust.texi +++ b/doc/rust.texi @@ -3157,7 +3157,7 @@ fn read_file_lines(&str path) -> vec[str] @{ note path; vec[str] r; file f = open_read(path); - for each (&str s in lines(f)) @{ + for each (str s in lines(f)) @{ vec.append(r,s); @} ret r; @@ -3258,19 +3258,19 @@ Example of 4 for loops, all identical: @example let vec[foo] v = vec(a, b, c); -for (&foo e in v.(0, _vec.len(v))) @{ +for (foo e in v.(0, _vec.len(v))) @{ bar(e); @} -for (&foo e in v.(0,)) @{ +for (foo e in v.(0,)) @{ bar(e); @} -for (&foo e in v.(,)) @{ +for (foo e in v.(,)) @{ bar(e); @} -for (&foo e in v) @{ +for (foo e in v) @{ bar(e); @} @end example @@ -3290,7 +3290,7 @@ Example of a foreach loop: @example let str txt; let vec[str] lines; -for each (&str s in _str.split(txt, "\n")) @{ +for each (str s in _str.split(txt, "\n")) @{ vec.push(lines, s); @} @end example |