andriyDev
347de61d13
Move the "Trait Bounds" slide right after "Generic Functions". ( #2589 )
...
The "Generic Data Types" slide now uses trait bounds, which makes it
very confusing to explain. (e.g., "ignore this trait bound stuff while I
explain why we need to stutter to describe the generic args on an impl
block").
Also in the "Generic Functions" slide, the speaker notes talks about how
we essentially need to treat the generic args as black boxes - this is
probably more important to address then talking about all the ways you
can make things generic.
2025-01-30 01:34:45 +00:00
Martin Geisler
deae2e2d53
Reduce vertical space slightly in UART examples ( #2407 )
...
Co-authored-by: Dustin J. Mitchell <djmitche@google.com>
2025-01-27 13:40:48 -05:00
Dustin J. Mitchell
a846003665
Switch lifetime and variable names so they are different ( #2586 )
...
This helps clarify that the lifetime and variables names do not need to
match, but sticks to related themes (doc / document) for human clarity.
As suggested by @fw-immunant in
https://github.com/google/comprehensive-rust/pull/2585#pullrequestreview-2569184433 ,
which subsequently auto-merged.
2025-01-23 14:55:59 -08:00
Dustin J. Mitchell
9c03d51b74
Add a picture to Rc ( #2583 )
...
I suppose my `svgbob` skills leave a bit to be desired, but I think the
meaning is clear:

Now that I look through the `Rc` implementation, there's a weak count
for every strong count, so the `weak: 0` here is inaccurate. But, maybe
this is too much of an implementation detail? Should I just concentrate
on strong refs? I suppose I could put a `...` in that upper-right box,
to suggest there's more going on here?
2025-01-23 09:28:20 -05:00
Dustin J. Mitchell
4ce87c5473
Improve tuple destructuring ( #2582 )
...
This slide had two code samples, neither of which had a `main` and thus
neither of which would run. This removes the first (which is redundant
to one a few slides earlier), adds a `main`, and expands the second to
use a 3-tuple.
2025-01-23 09:23:08 -05:00
Dustin J. Mitchell
b3734de08b
Include the From trait in the generic traits slide ( #2570 )
...
This saves a bunch of tabbing back and forth from the docs to the slide.
2025-01-23 09:43:43 +01:00
Dustin J. Mitchell
b3c57e4cbf
Be clear that the methods-and-traits exercise does not require generics ( #2568 )
...
When teaching the course, I got a little tripped up thinking students
would need to make the `VerbosityFilter` generic over `Logger`. Let's be
clearer that this is not required, and will be described later.
This also updates the generic-types slide to repeat the exercise,
completing that thought.
2025-01-23 09:40:59 +01:00
Dustin J. Mitchell
15e46379b1
Clarify struct-lifetimes slide ( #2585 )
...
In teaching the course, the verbal distinction between "doc" and "dog"
was not clear, so this PR moves away from those symbols.
This also makes the Highlight struct a little more substantial, and
replaces `erase` with a simple call to `drop` to keep the example short.
2025-01-23 09:35:11 +01:00
Dustin J. Mitchell
9f9f845acc
Break closures into its own segment ( #2574 )
...
In teaching the course last week, we broke here, partly due to time
constraints, but partly because this is a pretty mind-bending topic to
tackle at the end of an information-dense day. A break helps, and
spreading the content over a few slides helps as well.
By the timings in the course, this leaves day 2 looking like
*Fundamentals // Day 2 Morning*
_1 hour and 55 minutes: (1 hour and 10 minutes short)_
* Welcome - _3 minutes_
* Pattern Matching - _45 minutes_
* Methods and Traits - _50 minutes_
*Fundamentals // Day 2 Afternoon*
_3 hours and 30 minutes (⏰ *30 minutes too long*)_
* Welcome - _0 minutes_
* Generics - _45 minutes_
* Standard Library Types - _1 hour_
* Standard Library Traits - _1 hour_
* Closures - _20 minutes_
Maybe we should move generics to the morning session?
2025-01-23 09:32:59 +01:00
Dustin J. Mitchell
3b7442a498
Split let control flow into mutliple sub-slides ( #2567 )
...
There are three kinds of syntax here, making for a very long and
hard-to-navigate slide. Splitting it up helps!
2025-01-22 20:06:53 +01:00
Dustin J. Mitchell
f19bb8f10d
Briefly touch on match ergonomics ( #2581 )
...
This is done in the speaker notes as it's a relatively minor point, but
one that students should have in the back of their mind when they
wonder, "hey, how does a `&Foo` match against `Foo` patterns??"
2025-01-22 17:47:23 +01:00
Dustin J. Mitchell
5b03ea6ca5
Add empty structs ( #2569 )
...
This should be quick, but introduces the syntax and the concept of a
ZST.
2025-01-22 17:45:01 +01:00
dependabot[bot]
7f712b5292
Bump undici from 6.21.0 to 6.21.1 in /tests in the npm_and_yarn group across 1 directory ( #2580 )
...
Bumps the npm_and_yarn group with 1 update in the /tests directory:
[undici](https://github.com/nodejs/undici ).
Updates `undici` from 6.21.0 to 6.21.1
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/nodejs/undici/releases ">undici's
releases</a>.</em></p>
<blockquote>
<h2>v6.21.1</h2>
<h1>⚠️ Security Release ⚠️ </h1>
<p>Fixes CVE CVE-2025-22150 <a
href="https://github.com/nodejs/undici/security/advisories/GHSA-c76h-2ccp-4975 ">https://github.com/nodejs/undici/security/advisories/GHSA-c76h-2ccp-4975 </a>
(embargoed until 22-01-2025).</p>
<h2>What's Changed</h2>
<ul>
<li>fix(<a
href="https://redirect.github.com/nodejs/undici/issues/3736 ">#3736</a>):
back-port 183f8e9 to v6.x by <a
href="https://github.com/ggoodman "><code>@ggoodman</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/3855 ">nodejs/undici#3855</a></li>
<li>fix(<a
href="https://redirect.github.com/nodejs/undici/issues/3817 ">#3817</a>):
send servername for SNI on TLS (<a
href="https://redirect.github.com/nodejs/undici/issues/3821 ">#3821</a>)
[backport] by <a
href="https://github.com/metcoder95 "><code>@metcoder95</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/3864 ">nodejs/undici#3864</a></li>
<li>fix: sending formdata bodies with http2 (<a
href="https://redirect.github.com/nodejs/undici/issues/3863 ">#3863</a>)
[backport] by <a
href="https://github.com/metcoder95 "><code>@metcoder95</code></a> in <a
href="https://redirect.github.com/nodejs/undici/pull/3866 ">nodejs/undici#3866</a></li>
<li>[Backport v6.x] fix: Fixed the issue that there is no running
request when http2 goaway by <a
href="https://github.com/github-actions "><code>@github-actions</code></a>
in <a
href="https://redirect.github.com/nodejs/undici/pull/3877 ">nodejs/undici#3877</a></li>
<li>types: [backport] Update return type of RetryCallback (<a
href="https://redirect.github.com/nodejs/undici/issues/3851 ">#3851</a>)
by <a href="https://github.com/metcoder95 "><code>@metcoder95</code></a>
in <a
href="https://redirect.github.com/nodejs/undici/pull/3876 ">nodejs/undici#3876</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/nodejs/undici/compare/v6.21.0...v6.21.1 ">https://github.com/nodejs/undici/compare/v6.21.0...v6.21.1 </a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="e260e7bb17
"><code>e260e7b</code></a>
Bumped v6.21.1</li>
<li><a
href="c3acc6050b
"><code>c3acc60</code></a>
Merge commit from fork</li>
<li><a
href="2414bc9f7d
"><code>2414bc9</code></a>
Update return type of RetryCallback (<a
href="https://redirect.github.com/nodejs/undici/issues/3851 ">#3851</a>)
(<a
href="https://redirect.github.com/nodejs/undici/issues/3876 ">#3876</a>)</li>
<li><a
href="be8cd0afa0
"><code>be8cd0a</code></a>
[Backport v6.x] fix: Fixed the issue that there is no running request
when ht...</li>
<li><a
href="ee6176cd2e
"><code>ee6176c</code></a>
fix: sending formdata bodies with http2 (<a
href="https://redirect.github.com/nodejs/undici/issues/3863 ">#3863</a>)
[backport] (<a
href="https://redirect.github.com/nodejs/undici/issues/3866 ">#3866</a>)</li>
<li><a
href="a0220f14bf
"><code>a0220f1</code></a>
fix(<a
href="https://redirect.github.com/nodejs/undici/issues/3817 ">#3817</a>):
send servername for SNI on TLS (<a
href="https://redirect.github.com/nodejs/undici/issues/3821 ">#3821</a>)
[backport] (<a
href="https://redirect.github.com/nodejs/undici/issues/3864 ">#3864</a>)</li>
<li><a
href="353ab63188
"><code>353ab63</code></a>
fix(<a
href="https://redirect.github.com/nodejs/undici/issues/3736 ">#3736</a>):
back-port 183f8e9 to v6.x (<a
href="https://redirect.github.com/nodejs/undici/issues/3855 ">#3855</a>)</li>
<li>See full diff in <a
href="https://github.com/nodejs/undici/compare/v6.21.0...v6.21.1 ">compare
view</a></li>
</ul>
</details>
<br />
[](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores )
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/google/comprehensive-rust/network/alerts ).
</details>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-22 03:58:31 -05:00
andriyDev
3cca4735c4
Add return statements to the Fibonacci exercise. ( #2576 )
...
At this point in the course, we have not explained return statements.
Better to have it set up to avoid questions!
2025-01-21 16:15:13 +00:00
Martin Geisler
536cdf378f
Fix typo in TRANSLATIONS.md ( #2578 )
2025-01-21 08:49:54 +00:00
Dustin J. Mitchell
8121e7de7c
Split interior mutability, mention OnceCell/OnceLock ( #2573 )
...
These types are really only useful as a static or in a user-defined
type, neither of which are covered at this point.
2025-01-20 12:48:02 -05:00
Dustin J. Mitchell
5f7e0c3f64
Allow the 'unused' category of lints ( #2571 )
...
These sort of warnings can be distracting when commenting out a few
lines of code or demonstrating some other concept. They can be
re-enabled for a code block with `warnunused`.
I filed https://github.com/rust-lang/mdBook/issues/2527 to get behavior
like this upstream.
2025-01-20 12:47:50 -05:00
Dustin J. Mitchell
9fa1b645be
U stands for Undefined ( #2566 )
2025-01-19 22:14:33 -05:00
Dustin J. Mitchell
68e1ebd865
Change Expression Evaluation exercise to 15m ( #2561 )
...
Fixes #2559 .
2025-01-19 01:47:39 -05:00
Dustin J. Mitchell
f1ad41e2bc
Add TODO to indicate let-else example should be rewritten ( #2562 )
...
Fixes #2473 .
2025-01-19 01:47:33 -05:00
Max Heller
bcbe6b0876
Fix incorrectly hidden lines in Rust code blocks in PDFs ( #2565 )
...
Upgrades `mdbook-pandoc` to pull in a fix relating to hidden lines in
Rust code blocks. The bug was causing lines like `#[test]` to be hidden
when they should not have been.
## HTML
<img width="500" alt="Screenshot 2025-01-18 at 12 50 26 PM"
src="https://github.com/user-attachments/assets/c3363696-6ab6-4537-8285-fad047cb384f "
/>
## PDF (before)
<img width="500" alt="Screenshot 2025-01-18 at 12 51 25 PM"
src="https://github.com/user-attachments/assets/19539a9b-db24-41c5-98be-87d5a6228423 "
/>
## PDF (after)
<img width="500" alt="Screenshot 2025-01-18 at 12 52 25 PM"
src="https://github.com/user-attachments/assets/b19f1e6c-d717-449e-8799-c56d9b5401ca "
/>
2025-01-19 01:45:22 -05:00
Henri F.
957c404ad0
Revert "Fix a few accessibility violations" ( #2564 )
...
Reverts google/comprehensive-rust#2547
2025-01-17 01:53:58 -05:00
Martin Huschenbett
9e5c318a57
Fix minor inconsistencies and naming issues ( #2563 )
2025-01-17 01:53:37 -05:00
Dustin J. Mitchell
58bf01f1ef
Updates to APS segment of Bare-Metal ( #2560 )
2025-01-17 10:43:46 +08:00
Jonatandb
5af4a74591
es: Fix translation of course length ( #2552 )
...
Edit course length from 3 days to 4 which is actually the total length.
2025-01-16 09:36:32 +00:00
Dustin J. Mitchell
6dce638c6e
Reorder type aliases ( #2554 )
2025-01-16 10:30:32 +01:00
Dustin J. Mitchell
fec5f2eb48
Update timings for first 'references' segment ( #2553 )
...
Based on a course session just completed. The instruction itself took
less time, but the exercise took longer.
2025-01-16 10:29:59 +01:00
Dustin J. Mitchell
5f447b403b
Remove speaker note on "runtime evaluated constants" ( #2555 )
...
It's unclear what this would mean! It was introduced in 89ddb2c19.
2025-01-16 10:20:31 +01:00
Dustin J. Mitchell
3291cb6c62
Make const slide less silly ( #2557 )
...
A constant named ZERO that does not contain zero seems pretty silly!
This also shows an example of a const fn.
2025-01-16 10:18:29 +01:00
Dustin J. Mitchell
cb5409052a
Add timing for const slide ( #2556 )
...
I think this was missed when it split from the static slide. In the last
course session, we spent a fair amount of time on this slide.
2025-01-16 10:18:12 +01:00
Henri F.
f95c28f9a7
Fix a few accessibility violations ( #2547 )
...
* Add chrome.css and general.css to override default css file. This is
necessary to fix links without underline (hyperlinks relying only on
color).
* Fix pop-out button without id and wrong ARIA-ROLE
* Speaker's notes now at correct heading sequence (H3)
2025-01-15 19:11:19 -08:00
Alex Lai
aa548f4431
Revert "Exercise: method and traits: change output" ( #2548 )
...
Reverts google/comprehensive-rust#2383
Since #2397 is merged, to align the goal in #2478 , rollback this temp
workaround.
2025-01-15 10:22:48 +00:00
Martin Geisler
1c709efac0
Remove flaky JS test ( #2551 )
...
This should stop the test failures, but of course it won’t fix the
underlying problem.
Reverts part of #2513 . Related to #2549 .
2025-01-15 09:28:57 +01:00
Max Heller
9493a8deb7
Fix missing images and Arabic fonts in course PDFs ( #2544 )
...
Let's give #2531 another try
- Fixes missing images in PDFs (those specified as <img> elements)
- Configures Arabic fonts
[The
fix](https://github.com/max-heller/mdbook-pandoc/pull/144/files#diff-b17b0f99aa22ee1ccf99778ca74c3c7a27af87f41544194cc95f82c012e8a507 )
for the Persian translation issue, if you're curious.
2025-01-14 17:23:30 +01:00
kweber
0c91136396
de: synchronize the German translation ( #2543 )
...
I want to contribute to German translation, so i set up the complete
toolchain and git project for proper operation. This is my initial
commit to verify, that all is correct and i can continue.
2025-01-14 11:00:30 +01:00
Martin Geisler
093d980152
Add RustConf 2024 talk to Press section ( #2546 )
2025-01-14 10:57:04 +01:00
michael-kerscher
34920c76e6
tests: hello world playground run with success and failure tests ( #2513 )
...
Implement two tests for the rust playground:
- successful run of the hello world example with the hello world message
in stdout and a hidden stderr
- on purpose compilation error is shown in stderr and "No output" in
stdout
2025-01-14 10:44:23 +01:00
Younies Mahmoud
7584ce0048
Fix Wording Mistakes in TRANSLATIONS.md ( #2545 )
2025-01-13 20:35:03 -05:00
Dustin J. Mitchell
c04d2860e8
APS updates ( #2528 )
...
These are some minor updates from walking through the session myself.
* Add some context to the `entry.S` slide, which is otherwise a bit
terrifying for someone who does not speak ARM assembly.
* Include a simple, fake example of MMIO.
* Add a "Using It" section to the minimal UART segment, parallel to the
better UART
* Better explanation of the `unwrap` calls in the logging example.
Unwrap is never "unsafe", so remove that word.
* Allow dead code in some `.rs` files.
* Remove redundant warning about use of memory before MMU setup.
* Rephase text about buddy-system
* Fix lint warning in spin slide.
2025-01-07 19:07:39 +00:00
kamal
3764569198
Update translations.md ( #2538 )
...
Remove duplicate line containing details about language translation and
it's contributors.
2025-01-07 12:26:19 +00:00
Martin Huschenbett
8233599741
Use clamp in bare-metal compass solution ( #2537 )
...
The custom function `cap` does the same as `Ord::clamp`, which was
introduced in Rust 1.50. Let's use the latter instead.
I've flashed the new program onto my microbit and can confirm it still
works as intended.
2025-01-07 12:54:58 +01:00
Martin Geisler
76e2cfe53e
Revert "Upgrade mdbook-pandoc
to fix missing images in PDFs" ( #2540 )
...
Reverts google/comprehensive-rust#2531
This accidentally broke the build because the Persian translation
doesn't build with this version.
2025-01-05 11:15:20 -05:00
dependabot[bot]
8173e5fd74
cargo: bump the minor group with 3 updates ( #2534 )
...
Bumps the minor group with 3 updates:
[tokio](https://github.com/tokio-rs/tokio ),
[scraper](https://github.com/causal-agent/scraper ) and
[http](https://github.com/hyperium/http ).
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-02 08:52:58 +00:00
Max Heller
d4cc29ff0e
Upgrade mdbook-pandoc
to fix missing images in PDFs ( #2531 )
...
[`mdbook-pandoc`
0.8](https://github.com/max-heller/mdbook-pandoc/releases/tag/v0.8.0 )
now supports `<img>` elements in raw HTML, fixing a few missing images
in the PDF versions of the course.
2025-01-02 08:52:42 +00:00
dependabot[bot]
549391119b
cargo: bump the patch group in /src/exercises/bare-metal/rtc with 2 updates ( #2533 )
...
Bumps the patch group in /src/exercises/bare-metal/rtc with 2 updates:
[chrono](https://github.com/chronotope/chrono ) and
[cc](https://github.com/rust-lang/cc-rs ).
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-02 09:52:09 +01:00
dependabot[bot]
2c8786b392
cargo: bump cc from 1.2.2 to 1.2.6 in /src/bare-metal/aps/examples in the patch group ( #2532 )
...
Bumps the patch group in /src/bare-metal/aps/examples with 1 update:
[cc](https://github.com/rust-lang/cc-rs ).
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-02 09:51:42 +01:00
Dustin J. Mitchell
ac7c0506fd
Fix typo: build-essential, not build-essentials ( #2527 )
2025-01-02 09:41:16 +01:00
dependabot[bot]
a0ef82ef7c
cargo: bump the patch group with 12 updates ( #2535 )
...
Bumps the patch group with 12 updates:
| Package | From | To |
| --- | --- | --- |
| [anyhow](https://github.com/dtolnay/anyhow ) | `1.0.93` | `1.0.95` |
| [clap](https://github.com/clap-rs/clap ) | `4.5.21` | `4.5.23` |
| [serde](https://github.com/serde-rs/serde ) | `1.0.215` | `1.0.217` |
| [serde_json](https://github.com/serde-rs/json ) | `1.0.133` | `1.0.134`
|
| [fantoccini](https://github.com/jonhoo/fantoccini ) | `0.21.2` |
`0.21.3` |
| [glob](https://github.com/rust-lang/glob ) | `0.3.1` | `0.3.2` |
| [tokio-util](https://github.com/tokio-rs/tokio ) | `0.7.12` | `0.7.13`
|
| [zerocopy](https://github.com/google/zerocopy ) | `0.8.11` | `0.8.14` |
| [thiserror](https://github.com/dtolnay/thiserror ) | `2.0.3` | `2.0.9`
|
| [reqwest](https://github.com/seanmonstar/reqwest ) | `0.12.9` |
`0.12.12` |
| [cxx](https://github.com/dtolnay/cxx ) | `1.0.133` | `1.0.136` |
| [cxx-build](https://github.com/dtolnay/cxx ) | `1.0.133` | `1.0.136` |
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-02 09:35:25 +01:00
dependabot[bot]
3ffd55ca52
Bump crate-ci/typos from 1.28.1 to 1.29.0 ( #2536 )
...
Bumps [crate-ci/typos](https://github.com/crate-ci/typos ) from 1.28.1 to
1.29.0.
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-02 09:34:59 +01:00
Adrian Taylor
665300e373
Update Chromium Rust policy ( #2530 )
...
Co-authored-by: Dustin J. Mitchell <djmitche@google.com>
2024-12-28 21:08:34 +00:00