Skip to content

Commit

Permalink
Remove tangential text from if slide (#1840)
Browse files Browse the repository at this point in the history
  • Loading branch information
randomPoison authored Feb 23, 2024
1 parent 099ca49 commit 5ecdddf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
2 changes: 2 additions & 0 deletions book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ use-boolean-and = true
'unsafe/extern-functions.html' = '../unsafe-rust/unsafe-functions.html'
'unsafe/unsafe-traits.html' = '../unsafe-rust/unsafe-traits.html'
'exercises/day-3/safe-ffi-wrapper.html' = '../../unsafe-rust/exercise.html'
'hello-world/hello-world.html' = '../types-and-values/hello-world.html'
'control-flow-basics/conditionals.html' = 'if.html'

[output.exerciser]
output-directory = "comprehensive-rust-exercises"
2 changes: 1 addition & 1 deletion src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
- [Exercise: Fibonacci](types-and-values/exercise.md)
- [Solution](types-and-values/solution.md)
- [Control Flow Basics](control-flow-basics.md)
- [Conditionals](control-flow-basics/conditionals.md)
- [`if` Expressions](control-flow-basics/if.md)
- [Loops](control-flow-basics/loops.md)
- [`for`](control-flow-basics/loops/for.md)
- [`loop`](control-flow-basics/loops/loop.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,7 @@
minutes: 4
---

# Conditionals

Much of the Rust syntax will be familiar to you from C, C++ or Java:

- Blocks are delimited by curly braces.
- Line comments are started with `//`, block comments are delimited by
`/* ... */`.
- Keywords like `if` and `while` work the same.
- Variable assignment is done with `=`, comparison is done with `==`.

## `if` expressions
# `if` expressions

You use
[`if` expressions](https://doc.rust-lang.org/reference/expressions/if-expr.html#if-expressions)
Expand All @@ -21,8 +11,8 @@ exactly like `if` statements in other languages:
```rust,editable
fn main() {
let x = 10;
if x < 20 {
println!("small");
if x == 0 {
println!("zero!");
} else if x < 100 {
println!("biggish");
} else {
Expand Down

0 comments on commit 5ecdddf

Please sign in to comment.