Skip to content

Commit 8edf95a

Browse files
committed
Fix ranges in chapter 2 of mdbook
Ranges with 0..9 have exclusive upper bounds in Rust, 0..=9 would be inclusive. > The following program should print out the numbers one through ten.
1 parent 592914b commit 8edf95a

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

mdbook/src/chapter_2/chapter_2_1.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ fn main() {
2222
worker.dataflow(|scope| {
2323

2424
let stream1 = input.to_stream(scope);
25-
let stream2 = (0 .. 9).to_stream(scope);
25+
let stream2 = (0 .. 10).to_stream(scope);
2626

2727
});
2828

mdbook/src/chapter_2/chapter_2_2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use timely::dataflow::operators::{ToStream, Inspect};
1212
fn main() {
1313
timely::execute_from_args(std::env::args(), |worker| {
1414
worker.dataflow::<(),_,_>(|scope| {
15-
(0 .. 9)
15+
(0 .. 10)
1616
.to_stream(scope)
1717
.inspect(|x| println!("hello: {}", x));
1818
});

mdbook/src/chapter_2/chapter_2_3.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use timely::dataflow::operators::{ToStream, Inspect, Map};
1818
fn main() {
1919
timely::execute_from_args(std::env::args(), |worker| {
2020
worker.dataflow::<(),_,_>(|scope| {
21-
(0 .. 9)
21+
(0 .. 10)
2222
.to_stream(scope)
2323
.map(|x| x + 1)
2424
.inspect(|x| println!("hello: {}", x));
@@ -37,7 +37,7 @@ use timely::dataflow::operators::{ToStream, Inspect, Map};
3737
fn main() {
3838
timely::execute_from_args(std::env::args(), |worker| {
3939
worker.dataflow::<(),_,_>(|scope| {
40-
(0 .. 9)
40+
(0 .. 10)
4141
.to_stream(scope)
4242
.map(|x| x.to_string())
4343
.map(|mut x| { x.truncate(5); x } )
@@ -61,7 +61,7 @@ use timely::dataflow::operators::{ToStream, Inspect, Map};
6161
fn main() {
6262
timely::execute_from_args(std::env::args(), |worker| {
6363
worker.dataflow::<(),_,_>(|scope| {
64-
(0 .. 9)
64+
(0 .. 10)
6565
.to_stream(scope)
6666
.map(|x| x.to_string())
6767
.map_in_place(|x| x.truncate(5))
@@ -81,7 +81,7 @@ use timely::dataflow::operators::{ToStream, Inspect, Map};
8181
fn main() {
8282
timely::execute_from_args(std::env::args(), |worker| {
8383
worker.dataflow::<(),_,_>(|scope| {
84-
(0 .. 9)
84+
(0 .. 10)
8585
.to_stream(scope)
8686
.flat_map(|x| 0 .. x)
8787
.inspect(|x| println!("hello: {}", x));
@@ -102,7 +102,7 @@ use timely::dataflow::operators::{ToStream, Inspect, Filter};
102102
fn main() {
103103
timely::execute_from_args(std::env::args(), |worker| {
104104
worker.dataflow::<(),_,_>(|scope| {
105-
(0 .. 9)
105+
(0 .. 10)
106106
.to_stream(scope)
107107
.filter(|x| *x % 2 == 0)
108108
.inspect(|x| println!("hello: {}", x));

0 commit comments

Comments
 (0)