Skip to content
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

Reorder material on first two days #913

Merged
merged 5 commits into from
Aug 25, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ line-numbers = true
"unsafe/unsafe-functions.html" = "calling-unsafe-functions.html"
"welcome-bare-metal.html" = "bare-metal.html"
"welcome-day-4.html" = "concurrency.html"
# Moving exercises between days
"exercises/day-2/luhn.html" = "../day-1/luhn.html"
"exercises/day-2/points-polygons.html" = "../day-3/points-polygons.html"
"exercises/day-1/book-library.html" = "../day-2/book-library.html"
# Send people to canonical URL instead of index.html
"welcome.html" = "./"

Expand Down
68 changes: 38 additions & 30 deletions src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,43 @@

# Day 1: Afternoon

- [Control Flow](control-flow.md)
mgeisler marked this conversation as resolved.
Show resolved Hide resolved
- [Blocks](control-flow/blocks.md)
- [if expressions](control-flow/if-expressions.md)
- [for expressions](control-flow/for-expressions.md)
- [while expressions](control-flow/while-expressions.md)
- [break & continue](control-flow/break-continue.md)
- [loop expressions](control-flow/loop-expressions.md)

- [Variables](basic-syntax/variables.md)
- [Type Inference](basic-syntax/type-inference.md)
- [static & const](basic-syntax/static-and-const.md))
- [Scopes and Shadowing](basic-syntax/scopes-shadowing.md)
- [Enums](enums.md)
- [Variant Payloads](enums/variant-payloads.md)
- [Enum Sizes](enums/sizes.md)

- [Novel Control Flow]()
- [if let expressions](control-flow/if-let-expressions.md)
- [while let expressions](control-flow/while-let-expressions.md)
- [match expressions](control-flow/match-expressions.md)

- [Pattern Matching](pattern-matching.md)
mgeisler marked this conversation as resolved.
Show resolved Hide resolved
- [Destructuring Enums](pattern-matching/destructuring-enums.md)
- [Destructuring Structs](pattern-matching/destructuring-structs.md)
- [Destructuring Arrays](pattern-matching/destructuring-arrays.md)
- [Match Guards](pattern-matching/match-guards.md)

- [Exercises](exercises/day-1/afternoon.md)
- [Luhn Algorithm](exercises/day-1/luhn.md)
- [Pattern Matching exercise (TBD)]()

# Day 2: Morning

----

- [Welcome](welcome-day-2.md)

- [Memory Management](memory-management.md)
- [Stack vs Heap](memory-management/stack-vs-heap.md)
- [Stack Memory](memory-management/stack.md)
Expand All @@ -64,46 +97,21 @@
- [Lifetimes](ownership/lifetimes.md)
- [Lifetimes in Function Calls](ownership/lifetimes-function-calls.md)
- [Lifetimes in Data Structures](ownership/lifetimes-data-structures.md)
- [Exercises](exercises/day-1/afternoon.md)
- [Storing Books](exercises/day-1/book-library.md)
- [Iterators and Ownership](exercises/day-1/iterators-and-ownership.md)


# Day 2: Morning

----
- [Exercises](exercises/day-2/morning.md)
- [Storing Books](exercises/day-2/book-library.md)
- [Iterators and Ownership](exercises/day-2/iterators-and-ownership.md)

- [Welcome](welcome-day-2.md)
- [Structs](structs.md)
- [Tuple Structs](structs/tuple-structs.md)
- [Field Shorthand Syntax](structs/field-shorthand.md)
- [Enums](enums.md)
- [Variant Payloads](enums/variant-payloads.md)
- [Enum Sizes](enums/sizes.md)
- [Methods](methods.md)
- [Method Receiver](methods/receiver.md)
- [Example](methods/example.md)
- [Pattern Matching](pattern-matching.md)
- [Destructuring Enums](pattern-matching/destructuring-enums.md)
- [Destructuring Structs](pattern-matching/destructuring-structs.md)
- [Destructuring Arrays](pattern-matching/destructuring-arrays.md)
- [Match Guards](pattern-matching/match-guards.md)
- [Exercises](exercises/day-2/morning.md)
- [Exercises](exercises/day-2/afternoon.md)
- [Health Statistics](exercises/day-2/health-statistics.md)
- [Points and Polygons](exercises/day-2/points-polygons.md)

# Day 2: Afternoon

- [Control Flow](control-flow.md)
- [Blocks](control-flow/blocks.md)
- [if expressions](control-flow/if-expressions.md)
- [if let expressions](control-flow/if-let-expressions.md)
- [while expressions](control-flow/while-expressions.md)
- [while let expressions](control-flow/while-let-expressions.md)
- [for expressions](control-flow/for-expressions.md)
- [loop expressions](control-flow/loop-expressions.md)
- [match expressions](control-flow/match-expressions.md)
- [break & continue](control-flow/break-continue.md)
- [Standard Library](std.md)
- [Option and Result](std/option-result.md)
- [String](std/string.md)
Expand All @@ -119,7 +127,6 @@
- [Paths](modules/paths.md)
- [Filesystem Hierarchy](modules/filesystem.md)
- [Exercises](exercises/day-2/afternoon.md)
- [Luhn Algorithm](exercises/day-2/luhn.md)
- [Strings and Iterators](exercises/day-2/strings-iterators.md)


Expand Down Expand Up @@ -149,6 +156,7 @@
- [Closures: Fn, FnMut, FnOnce](traits/closures.md)
- [Exercises](exercises/day-3/morning.md)
- [A Simple GUI Library](exercises/day-3/simple-gui.md)
- [Points and Polygons](exercises/day-3/points-polygons.md)

# Day 3: Afternoon

Expand Down
22 changes: 11 additions & 11 deletions src/exercises/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,30 @@ publish = false
name = "for-loops"
path = "day-1/for-loops.rs"

[[bin]]
name = "luhn"
path = "day-1/luhn.rs"

[[bin]]
name = "book-library"
path = "day-1/book-library.rs"
path = "day-2/book-library.rs"

[[bin]]
name = "points-polygons"
path = "day-2/points-polygons.rs"
name = "strings-iterators"
path = "day-2/strings-iterators.rs"

[[bin]]
name = "luhn"
path = "day-2/luhn.rs"
name = "simple-gui"
path = "day-3/simple-gui.rs"

[[bin]]
name = "strings-iterators"
path = "day-2/strings-iterators.rs"
name = "points-polygons"
path = "day-3/points-polygons.rs"

[[bin]]
name = "safe-ffi-wrapper"
path = "day-3/safe-ffi-wrapper.rs"

[[bin]]
name = "simple-gui"
path = "day-3/simple-gui.rs"

[[bin]]
name = "dining-philosophers"
path = "concurrency/dining-philosophers.rs"
Expand Down
4 changes: 2 additions & 2 deletions src/exercises/day-1/afternoon.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

We will look at two things:

* A small book library,
* The Luhn algorithm,

* Iterators and ownership (hard).
* An exercise on pattern matching.

<details>

Expand Down
File renamed without changes.
File renamed without changes.
10 changes: 7 additions & 3 deletions src/exercises/day-1/solutions-afternoon.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# Day 1 Afternoon Exercises

## Designing a Library
## Luhn Algorithm

([back to exercise](book-library.md))
([back to exercise](luhn.md))

```rust
{{#include book-library.rs}}
{{#include luhn.rs}}
```

## Pattern matching

TBD.
8 changes: 0 additions & 8 deletions src/exercises/day-2/solutions-afternoon.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
# Day 2 Afternoon Exercises

## Luhn Algorithm

([back to exercise](luhn.md))

```rust
{{#include luhn.rs}}
```

## Strings and Iterators

([back to exercise](strings-iterators.md))
Expand Down
6 changes: 3 additions & 3 deletions src/exercises/day-2/solutions-morning.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Day 2 Morning Exercises

## Points and Polygons
## Designing a Library

([back to exercise](points-polygons.md))
([back to exercise](book-library.md))

```rust
{{#include points-polygons.rs}}
{{#include book-library.rs}}
```
4 changes: 3 additions & 1 deletion src/exercises/day-3/morning.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Day 3: Morning Exercises

We will design a classical GUI library traits and trait objects.
We will design a classical GUI library using traits and trait objects.

We will also look at enum dispatch with an exercise involving points and polygons.

<details>

Expand Down
8 changes: 8 additions & 0 deletions src/exercises/day-3/solutions-morning.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,11 @@
```rust
{{#include simple-gui.rs}}
```

## Points and Polygons

([back to exercise](points-polygons.md))

```rust
{{#include points-polygons.rs}}
```
6 changes: 3 additions & 3 deletions src/running-the-course/course-structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

The course is fast paced and covers a lot of ground:

* Day 1: Basic Rust, ownership and the borrow checker.
* Day 2: Compound data types, pattern matching, the standard library.
* Day 3: Traits and generics, error handling, testing, unsafe Rust.
* Day 1: Basic Rust, syntax, control flow, creating and consuming values.
* Day 2: Memory management, ownership, compound data types, and the standard library.
* Day 3: Generics, traits, error handling, testing, and unsafe Rust.

## Deep Dives

Expand Down
6 changes: 3 additions & 3 deletions src/welcome-day-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ today:
* Basic Rust syntax: variables, scalar and compound types, enums, structs,
references, functions, and methods.

* Memory management: stack vs heap, manual memory management, scope-based memory
management, and garbage collection.
* Control flow constructs: `if`, `if let`, `while`, `while let`, `break`, and
`continue`.

* Ownership: move semantics, copying and cloning, borrowing, and lifetimes.
* Pattern matching: destructuring enums, structs, and arrays.

<details>

Expand Down
8 changes: 4 additions & 4 deletions src/welcome-day-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

Now that we have seen a fair amount of Rust, we will continue with:

* Structs, enums, methods.
* Memory management: stack vs heap, manual memory management, scope-based memory
management, and garbage collection.

* Pattern matching: destructuring enums, structs, and arrays.
* Ownership: move semantics, copying and cloning, borrowing, and lifetimes.

* Control flow constructs: `if`, `if let`, `while`, `while let`, `break`, and
`continue`.
* Structs and methods.

* The Standard Library: `String`, `Option` and `Result`, `Vec`, `HashMap`, `Rc`
and `Arc`.
Expand Down