1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-06-15 13:50:27 +02:00
Commit Graph

622 Commits

Author SHA1 Message Date
b1e11304a7 Speaker notes for “Runtime Guarantees” 2023-01-09 14:27:13 +01:00
ba3c6b0de9 Speaker notes for “Modern Features” 2023-01-09 14:27:13 +01:00
cf505e99cd Rephrase “No memory leaks”
The footnote was added before we had support for speaker notes. It’s
too large to show on the screen during a classroom presentation, so it
has now been moved to the speaker notes.

I tried to keep the information intact, including keeping the word
“mostly” on the slide.
2023-01-09 14:26:47 +01:00
a7adf49002 Speaker notes for “Why Rust?” 2023-01-09 14:26:47 +01:00
50b0ad76eb Introduce speaker notes on welcome page 2023-01-09 14:24:02 +01:00
49b4fff348 Merge pull request #131 from fbornhofen/main
Add speaker notes to copy-clone.md
2023-01-09 13:05:02 +00:00
0723135dc6 Remove bullet point about printing p1 2023-01-09 13:39:39 +01:00
45bc1233d2 s/twice/again/ 2023-01-09 13:37:06 +01:00
e213f9dbd3 Add speaker notes to copy-clone.md 2023-01-09 13:20:00 +01:00
ba275812aa Merge pull request #129 from hezhizhen/patch-1
Fix typo in `structure.md`
2023-01-09 10:14:57 +00:00
b287aeada1 Fix typo in structure.md 2023-01-09 02:01:28 +08:00
7e0670e6b7 Merge pull request #126 from marshallpierce/patch-2
Use rustls instead of openssl
2023-01-07 14:50:18 +01:00
ca0f475fad Merge pull request #127 from imichael2e2/main
Update broken links
2023-01-07 14:49:11 +01:00
3f4ae0606d Update broken links 2023-01-07 15:38:40 +08:00
d3605aaaee Merge pull request #125 from google/dependabot/cargo/tokio-1.24.1
Bump tokio from 1.23.0 to 1.24.1
2023-01-06 22:26:43 +00:00
b67908698f Use rustls instead of openssl
Using the `rustls-tls` feature on reqwest will use rustls and ring, which should compile on any system.
2023-01-06 15:22:40 -07:00
0b7357a32d Bump tokio from 1.23.0 to 1.24.1
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.23.0 to 1.24.1.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.23.0...tokio-1.24.1)

---
updated-dependencies:
- dependency-name: tokio
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-06 22:02:55 +00:00
68eed5b4f2 Error handling: clarify printing of Result
Two examples may print either `Ok(username)` or `Err(error)`.
This commit clarifies this fact.
2023-01-06 12:35:05 -08:00
e074b8c87f Merge pull request #122 from marshallpierce/patch-1
Create an empty Vec rather than pre-allocating
2023-01-06 17:51:56 +01:00
0a9dd33e58 Create an empty rather than pre-allocating
It might give the impression that you can only write to a Vec that has capacity, when in fact Vec's Write impl will grow the storage as needed. While pre-allocating is probably a good efficiency win in many circumstances, I think it's probably worth minimizing the number of concepts in play in this example.
2023-01-06 09:47:42 -07:00
c8f626e573 for-loop bonus explanation (#108)
* for-loop bonus explanation
2023-01-06 10:15:16 +01:00
9a68434cac Merge pull request #49 from ilyagr/patch-1
`anyhow`: Remove `ReadUsernameError::IoError`
2023-01-05 15:57:17 +01:00
6e8942ef12 Merge pull request #112 from google/speaker-notes-closed
Show speaker notes as closed by default
2023-01-05 10:48:09 +01:00
59e4a912ca Merge pull request #113 from google/no-speaker-notes-on-mobile
Hide speaker note popup link on mobile
2023-01-05 10:08:15 +01:00
34f28cd4a0 Merge pull request #114 from yesenarman/patch-2
Fix a typo in `result.md`
2023-01-05 08:47:44 +00:00
e1c670c4a8 Fix a typo in result.md
"have already see" -> "have already seen"
2023-01-05 14:41:40 +06:00
8feb6b4ad4 Merge pull request #109 from rhapsodyai/fixes-99
Fixes: #99
2023-01-05 09:08:03 +01:00
019e464ba8 Hide speaker note popup link on mobile
This uses the same media query as the rest of the mdbook theme:
devices with a width less than 1080px (mobiles) will not see the link
to open speaker notes in a new window.
2023-01-05 08:27:19 +01:00
986d607d1e Show speaker notes as closed by default
This makes it clearer that the notes are extra content.
2023-01-05 08:06:09 +01:00
15f88b3700 Merge pull request #107 from google/speaker-notes
Add support for speaker notes
2023-01-05 07:48:01 +01:00
d5359fa92a Add support for speaker notes
This implements a system for speaker notes via `details` elements and
some JavaScript. The general idea is

1. You add speaker notes to each page by wrapping some Markdown code
   in `<details> … </details>`. This is a standard HTML element for,
   well extra details. Browsers will render the element with a toggle
   control for showing/hiding the content.

2. We inject JavaScript on every page which finds these speaker note
   elements. They’re styled slightly and we keep their open/closed
   state in a browser local storage. This ensures that you can keep
   them open/closed across page loads.

3. We add a link to the speaker notes which will open in a new tab.
   The URL is amended with `#speaker-notes-open`, which we detect in
   the new tab: we hide the other content in this case.
   Simultaneously, we hide the speaker notes in the original window.

4. When navigating to a new page, we signal this to the other window.
   We then navigate to the same page. The logic above kicks in and
   hides the right part of the content. This lets the users page
   through the course using either the regular window or the speaker
   notes — the result is the same and both windows stay in sync.

Tested in both Chrome and Firefox. When using a popup speaker note
window, the content loads more smoothly in Chrome, but it still works
fine in Firefox.

Fixes #53.
2023-01-05 07:46:18 +01:00
115c87d8fd Fixes: #99 2023-01-04 17:55:28 -08:00
28942d7b9f Merge pull request #36 from daym/patch-1
Tuples with "..." make no sense, so don't use them
2023-01-04 15:42:35 +00:00
9f46beafdb Merge pull request #105 from Adrian-Samoticha/patch-1
Fix typo in `modules.md`
2023-01-04 15:42:07 +00:00
1fb87d4b81 Merge pull request #106 from Adrian-Samoticha/patch-2
Fix typo in `visibility.md`
2023-01-04 15:41:59 +00:00
a0ad1eafa8 Fix typo in visibility.md 2023-01-04 15:58:34 +01:00
89ad1f6a65 Fix typo in modules.md 2023-01-04 15:44:37 +01:00
c2c11531a5 Merge pull request #96 from zhouwfang/simplify-solution-to-prefix-matching
Simplify the solution to prefix matching
2023-01-04 09:11:58 +01:00
bffd70a90e Merge pull request #104 from liao02x/patch-1
fix typo in deriving-error-enums.md
2023-01-04 09:10:18 +01:00
8d36a3bdd3 fix typo in deriving-error-enums.md 2023-01-03 21:18:30 -08:00
1fb0b0a46d Simplify solution to prefix matching. 2023-01-03 20:11:20 -08:00
eee3fb6302 Merge pull request #101 from google/course-target-audience
Explain who the course is for
2023-01-03 18:10:09 +01:00
571c87283d Explain how the course can be used
From a discussion on Twitter:
https://twitter.com/bluxte/status/1610297443324727298.
2023-01-03 16:55:33 +01:00
78766a6bf6 Merge pull request #98 from google/simplify-publish
Simplify the publish workflow
2023-01-03 15:57:50 +01:00
499657c830 Simplify the publish workflow
This removes a bunch of boiler-plate comments which were left from the
template I used originally.

It also simplifies the name to just “Publish” since I feel this fits
better for what we do here.
2023-01-03 15:49:21 +01:00
9d41acf22d Merge pull request #97 from google/cargo-test
Run `cargo test` on pull requests
2023-01-03 15:47:48 +01:00
a0a1398b9b Simplify workflow name
Now that we multiple jobs, this will look better in the GitHut output:
“Build / mdbook (pull_request)” and “Test / mdbook (pull_request)”.
2023-01-03 14:46:25 +01:00
6f49dcf2fe Add Cargo.lock
This captures a set of known-good dependencies for the provided
solutions.
2023-01-03 14:42:33 +01:00
1bfe3cf7a2 Run cargo test on pull requests
This uses the `Cargo.toml` file in the repository to test the provided
solutions.
2023-01-03 14:39:24 +01:00
2a92487bbd Merge pull request #94 from MaschitaG/patch-2
Unsafe Rust
2023-01-02 10:32:00 +01:00