Skip to content

Commit 5ecdddf

Browse files
authored
Remove tangential text from if slide (#1840)
1 parent 099ca49 commit 5ecdddf

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

book.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,8 @@ use-boolean-and = true
233233
'unsafe/extern-functions.html' = '../unsafe-rust/unsafe-functions.html'
234234
'unsafe/unsafe-traits.html' = '../unsafe-rust/unsafe-traits.html'
235235
'exercises/day-3/safe-ffi-wrapper.html' = '../../unsafe-rust/exercise.html'
236+
'hello-world/hello-world.html' = '../types-and-values/hello-world.html'
237+
'control-flow-basics/conditionals.html' = 'if.html'
236238

237239
[output.exerciser]
238240
output-directory = "comprehensive-rust-exercises"

src/SUMMARY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
- [Exercise: Fibonacci](types-and-values/exercise.md)
3131
- [Solution](types-and-values/solution.md)
3232
- [Control Flow Basics](control-flow-basics.md)
33-
- [Conditionals](control-flow-basics/conditionals.md)
33+
- [`if` Expressions](control-flow-basics/if.md)
3434
- [Loops](control-flow-basics/loops.md)
3535
- [`for`](control-flow-basics/loops/for.md)
3636
- [`loop`](control-flow-basics/loops/loop.md)

src/control-flow-basics/conditionals.md renamed to src/control-flow-basics/if.md

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,7 @@
22
minutes: 4
33
---
44

5-
# Conditionals
6-
7-
Much of the Rust syntax will be familiar to you from C, C++ or Java:
8-
9-
- Blocks are delimited by curly braces.
10-
- Line comments are started with `//`, block comments are delimited by
11-
`/* ... */`.
12-
- Keywords like `if` and `while` work the same.
13-
- Variable assignment is done with `=`, comparison is done with `==`.
14-
15-
## `if` expressions
5+
# `if` expressions
166

177
You use
188
[`if` expressions](https://doc.rust-lang.org/reference/expressions/if-expr.html#if-expressions)
@@ -21,8 +11,8 @@ exactly like `if` statements in other languages:
2111
```rust,editable
2212
fn main() {
2313
let x = 10;
24-
if x < 20 {
25-
println!("small");
14+
if x == 0 {
15+
println!("zero!");
2616
} else if x < 100 {
2717
println!("biggish");
2818
} else {

0 commit comments

Comments
 (0)