-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added loops section #1789
Added loops section #1789
Conversation
Specifying ```Vec::<String>::new()``` explicitly indicates that variable is intended to be a vector containing String elements. This can be helpful for documenting the code and ensuring that variable is used correctly throughout the codebase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks!
src/control-flow-basics/loops.md
Outdated
@@ -8,51 +8,15 @@ There are three looping keywords in Rust: `while`, `loop`, and `for`: | |||
|
|||
## `while` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid students seeing an empty "table of contents" slide, let's include the first section (while
) here in src/control-flow-basics/loops.md
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
src/control-flow-basics/loops/for.md
Outdated
@@ -0,0 +1,16 @@ | |||
--- | |||
minutes: 5 | |||
--- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sub-slides can omit this timing information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^^ still needs to be done
@@ -0,0 +1,21 @@ | |||
--- | |||
minutes: 5 | |||
--- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this too.
@@ -0,0 +1,20 @@ | |||
--- | |||
minutes: 5 | |||
--- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll also need a change to SUMMARY.md
so that these new sub-slides actually appear in the output. You can test this using mdbook serve
as seen in the README.md
file.
Note, too, that if you install dprint
as described in CONTRIBUTING.md
, then dprint fmt
will fix the formatting for you.
src/control-flow-basics/loops/for.md
Outdated
@@ -0,0 +1,16 @@ | |||
--- | |||
minutes: 5 | |||
--- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^^ still needs to be done
src/control-flow-basics/loops/for.md
Outdated
minutes: 5 | ||
--- | ||
|
||
## `for` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a top-level heading for this sub-slide, so use #
@@ -0,0 +1,17 @@ | |||
## `loop` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#
src/control-flow-basics/loops.md
Outdated
@@ -25,39 +25,8 @@ fn main() { | |||
|
|||
## `for` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these headings and links can be omitted -- students and instructors typically page through the course with the next and previous links, so the next link will take them to for
, and on to loop
.
Ok. I will complete the changes. |
I edited |
Oh, that's frustrating -- GitHub picked the wrong email address for me. I can fix it up before merging. |
Tommarow ,I will complete break and continue slide. |
This is a contribution of a loops section for Comprehensive Rust.