1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2024-11-21 13:25:53 +02:00
Commit Graph

2120 Commits

Author SHA1 Message Date
Martin Geisler
2256525a90
Be explicit that Android examples need a Git checkout (#2465)
Without this, students will see subtle differences between what is on
the slides and what we have in the code (see #2464 for an example).
2024-11-19 13:25:44 -05:00
Martin Geisler
088169b989
Make page title more specific (#2405)
Naming the slide “Bare-Metal Android” avoids an annoying situation
when searching: before, searching for “android” would list this slide
as a top hit because it matches the search term precisely. This meant
that the whole Rust in Android section course was harder to find.

With this change, the “Welcome to Rust in Android” page becomes easier
to find.
2024-11-19 16:13:37 +00:00
Moritz Firsching
6148caed7a
Change tests for pattern-matching exercise (#2463)
to catch wrong `right == 0` checks.

To change the number like this catches for example a wrong
implementation only looking if `right_result` is zero, but not checking
if we are doing a division.
2024-11-18 16:11:58 +00:00
Martin Geisler
7f59978a0a
Update Rust before setting up the cache (#2460)
The cache is keyed on the Rust version used, so we should update Rust
before setting up the cache.

This is a small update to #2449.
2024-11-12 10:26:42 +01:00
Semih Buyukgungor
b4f07baf81
Update unsafe trait example to zerocopy version 0.8 (#2434)
Zerocopy crate version 0.8 introduced changes to its API, which caused
the example code to break.
https://github.com/google/zerocopy/discussions/1680
> AsBytes ->
[IntoBytes](https://docs.rs/zerocopy/0.8.*/zerocopy/trait.IntoBytes.html)

---------

Co-authored-by: Martin Geisler <martin@geisler.net>
2024-11-04 11:01:45 +00:00
dependabot[bot]
b6b4381722
cargo: bump the minor group across 1 directory with 3 updates (#2459)
Bumps the minor group with 3 updates in the / directory:
[tokio](https://github.com/tokio-rs/tokio),
[zerocopy](https://github.com/google/zerocopy) and
[scraper](https://github.com/causal-agent/scraper).

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Andrew Walbran <qwandor@google.com>
2024-11-04 10:28:53 +00:00
dependabot[bot]
f7d2ab541a
cargo: bump cc from 1.1.23 to 1.1.31 in /src/bare-metal/aps/examples in the patch group (#2455)
Bumps the patch group in /src/bare-metal/aps/examples with 1 update:
[cc](https://github.com/rust-lang/cc-rs).

Updates `cc` from 1.1.23 to 1.1.31
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/rust-lang/cc-rs/releases">cc's
releases</a>.</em></p>
<blockquote>
<h2>cc-v1.1.31</h2>
<h3>Other</h3>
<ul>
<li>Add comment explaining why cc does not rebuild on env PATH change
(<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1247">#1247</a>)</li>
</ul>
<h2>cc-v1.1.30</h2>
<h3>Other</h3>
<ul>
<li>Don't pass -fPIC by default on wasm (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1245">#1245</a>)</li>
</ul>
<h2>cc-v1.1.29</h2>
<h3>Other</h3>
<ul>
<li>Regenerate target info (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1243">#1243</a>)</li>
</ul>
<h2>cc-v1.1.28</h2>
<h3>Other</h3>
<ul>
<li>Environment variables: For one accepting boolean, treat
&quot;0&quot;, &quot;false&quot; and empty env as false (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1238">#1238</a>)</li>
</ul>
<h2>cc-v1.1.27</h2>
<h3>Other</h3>
<ul>
<li>Revert &quot;Use debug version of MSVC runtime library on debug (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1231">#1231</a>)&quot;
(<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1237">#1237</a>)</li>
<li>Disable <code>CC_ENABLE_DEBUG_OUTPUT</code> if it is set to
&quot;0&quot; (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1234">#1234</a>)</li>
</ul>
<h2>cc-v1.1.26</h2>
<h3>Other</h3>
<ul>
<li>Use debug version of MSVC runtime library on debug (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1231">#1231</a>)</li>
</ul>
<h2>cc-v1.1.25</h2>
<h3>Other</h3>
<ul>
<li>Remove incorrect &quot;lib&quot; prefixes in CXXSTDLIB doc comments
(<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1228">#1228</a>)</li>
</ul>
<h2>cc-v1.1.24</h2>
<h3>Other</h3>
<ul>
<li>Fix wasm32-wasip1-threads: shared-memory disallowed due to not
compiled with 'atomics' or 'bulk-memory' features (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1221">#1221</a>)</li>
<li>Reduce the need for the host target triple (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1224">#1224</a>)</li>
<li>Add auto cancellation for CI jobs (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1222">#1222</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md">cc's
changelog</a>.</em></p>
<blockquote>
<h2><a
href="https://github.com/rust-lang/cc-rs/compare/cc-v1.1.30...cc-v1.1.31">1.1.31</a>
- 2024-10-19</h2>
<h3>Other</h3>
<ul>
<li>Add comment explaining why cc does not rebuild on env PATH change
(<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1247">#1247</a>)</li>
</ul>
<h2><a
href="https://github.com/rust-lang/cc-rs/compare/cc-v1.1.29...cc-v1.1.30">1.1.30</a>
- 2024-10-11</h2>
<h3>Other</h3>
<ul>
<li>Don't pass -fPIC by default on wasm (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1245">#1245</a>)</li>
</ul>
<h2><a
href="https://github.com/rust-lang/cc-rs/compare/cc-v1.1.28...cc-v1.1.29">1.1.29</a>
- 2024-10-11</h2>
<h3>Other</h3>
<ul>
<li>Regenerate target info (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1243">#1243</a>)</li>
</ul>
<h2><a
href="https://github.com/rust-lang/cc-rs/compare/cc-v1.1.27...cc-v1.1.28">1.1.28</a>
- 2024-10-06</h2>
<h3>Other</h3>
<ul>
<li>Environment variables: For one accepting boolean, treat
&quot;0&quot;, &quot;false&quot; and empty env as false (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1238">#1238</a>)</li>
</ul>
<h2><a
href="https://github.com/rust-lang/cc-rs/compare/cc-v1.1.26...cc-v1.1.27">1.1.27</a>
- 2024-10-06</h2>
<h3>Other</h3>
<ul>
<li>Revert &quot;Use debug version of MSVC runtime library on debug (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1231">#1231</a>)&quot;
(<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1237">#1237</a>)</li>
<li>Disable <code>CC_ENABLE_DEBUG_OUTPUT</code> if it is set to
&quot;0&quot; (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1234">#1234</a>)</li>
</ul>
<h2><a
href="https://github.com/rust-lang/cc-rs/compare/cc-v1.1.25...cc-v1.1.26">1.1.26</a>
- 2024-10-06</h2>
<h3>Other</h3>
<ul>
<li>Use debug version of MSVC runtime library on debug (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1231">#1231</a>)</li>
</ul>
<h2><a
href="https://github.com/rust-lang/cc-rs/compare/cc-v1.1.24...cc-v1.1.25">1.1.25</a>
- 2024-10-05</h2>
<h3>Other</h3>
<ul>
<li>Remove incorrect &quot;lib&quot; prefixes in CXXSTDLIB doc comments
(<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1228">#1228</a>)</li>
</ul>
<h2><a
href="https://github.com/rust-lang/cc-rs/compare/cc-v1.1.23...cc-v1.1.24">1.1.24</a>
- 2024-10-01</h2>
<h3>Other</h3>
<ul>
<li>Fix wasm32-wasip1-threads: shared-memory disallowed due to not
compiled with 'atomics' or 'bulk-memory' features (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1221">#1221</a>)</li>
<li>Reduce the need for the host target triple (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1224">#1224</a>)</li>
<li>Add auto cancellation for CI jobs (<a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1222">#1222</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="c07ab0ea4e"><code>c07ab0e</code></a>
chore: release v1.1.31 (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1248">#1248</a>)</li>
<li><a
href="e53eba374f"><code>e53eba3</code></a>
Add comment explaining why cc does not rebuild on env PATH change (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1247">#1247</a>)</li>
<li><a
href="9aab24207c"><code>9aab242</code></a>
chore: release (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1246">#1246</a>)</li>
<li><a
href="d0048ab136"><code>d0048ab</code></a>
Don't pass -fPIC by default on wasm (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1245">#1245</a>)</li>
<li><a
href="53a0b97ef8"><code>53a0b97</code></a>
chore: release (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1244">#1244</a>)</li>
<li><a
href="7ad4677a4e"><code>7ad4677</code></a>
Regenerate target info (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1243">#1243</a>)</li>
<li><a
href="218365e583"><code>218365e</code></a>
chore: release (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1239">#1239</a>)</li>
<li><a
href="1a6a7103d9"><code>1a6a710</code></a>
Environment variables: For one accepting boolean, treat &quot;0&quot;,
&quot;false&quot; and empt...</li>
<li><a
href="3bbb3849ae"><code>3bbb384</code></a>
chore: release (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1235">#1235</a>)</li>
<li><a
href="2b94f52d47"><code>2b94f52</code></a>
Revert &quot;Use debug version of MSVC runtime library on debug (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1231">#1231</a>)&quot;
(<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1237">#1237</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/rust-lang/cc-rs/compare/cc-v1.1.23...cc-v1.1.31">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=cc&package-manager=cargo&previous-version=1.1.23&new-version=1.1.31)](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


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-04 10:03:21 +00:00
dependabot[bot]
5a57631911
build(deps): bump crate-ci/typos from 1.24.6 to 1.26.8 (#2451)
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.24.6 to
1.26.8.
2024-11-01 13:54:06 +00:00
Andrew Walbran
f8882190f3
Updates for Rust 1.82 (#2449)
Rust 1.82 adds `&raw` expressions, and marks some attributes as unsafe.
2024-11-01 08:39:56 +01:00
dependabot[bot]
2bba470415
cargo: bump panic-halt from 0.2.0 to 1.0.0 in /src/bare-metal/alloc-example (#2458)
Bumps [panic-halt](https://github.com/korken89/panic-halt) from 0.2.0 to
1.0.0.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-01 08:34:33 +01:00
dependabot[bot]
e47a557e89
cargo: bump panic-halt from 0.2.0 to 1.0.0 in /src/bare-metal/microcontrollers/examples (#2457)
Bumps [panic-halt](https://github.com/korken89/panic-halt) from 0.2.0 to
1.0.0.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-01 08:33:50 +01:00
dependabot[bot]
9da4562400
cargo: bump cc from 1.1.23 to 1.1.31 in /src/exercises/bare-metal/rtc in the patch group (#2453)
Bumps the patch group in /src/exercises/bare-metal/rtc 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>
2024-11-01 08:33:28 +01:00
dependabot[bot]
afec47fccc
cargo: bump panic-halt from 0.2.0 to 1.0.0 in /src/exercises/bare-metal/compass (#2452)
Bumps [panic-halt](https://github.com/korken89/panic-halt) from 0.2.0 to
1.0.0.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-01 08:32:50 +01:00
dependabot[bot]
9dcfc7e4d8
cargo: bump the patch group with 11 updates (#2456)
Bumps the patch group with 11 updates:

| Package | From | To |
| --- | --- | --- |
| [anyhow](https://github.com/dtolnay/anyhow) | `1.0.89` | `1.0.91` |
| [clap](https://github.com/clap-rs/clap) | `4.5.18` | `4.5.20` |
| [regex](https://github.com/rust-lang/regex) | `1.11.0` | `1.11.1` |
| [serde](https://github.com/serde-rs/serde) | `1.0.210` | `1.0.214` |
| [serde_json](https://github.com/serde-rs/json) | `1.0.128` | `1.0.132`
|
| [pulldown-cmark](https://github.com/raphlinus/pulldown-cmark) |
`0.12.1` | `0.12.2` |
| [thiserror](https://github.com/dtolnay/thiserror) | `1.0.64` |
`1.0.66` |
| [reqwest](https://github.com/seanmonstar/reqwest) | `0.12.8` |
`0.12.9` |
| [futures-util](https://github.com/rust-lang/futures-rs) | `0.3.30` |
`0.3.31` |
| [cxx](https://github.com/dtolnay/cxx) | `1.0.128` | `1.0.129` |
| [cxx-build](https://github.com/dtolnay/cxx) | `1.0.128` | `1.0.129` |

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-01 08:29:38 +01:00
Martin Geisler
1d7c9163f5
Simplify imports by importing fewer items directly (#2404)
When reading the code without an IDE, I find it useful to use explicit
module names, especially when items come from the standard library.

So `io::Error` instead of just `Error`, especially when people have
just been told about `std::error::Error` as well.

I also omitted most single-use items: I find it has less cognitive
overhead to say “we import `fmt`” and then later use `fmt::Display`
and `fmt::Formatter` in the code. It’s clear from the name that these
two things have something to do with formatting.

Finally, I made a few usages more consistent so that we refer to each
item in the same way within a single codeblock.
2024-10-29 11:19:58 +01:00
Martin Geisler
7a462efb57
Ensure examples compile on latest version of AOSP (#2414)
This is part of #2398.
2024-10-28 19:35:54 +01:00
Martin Geisler
c16c07a53a
The Error trait is in core as of Rust 1.81.0 (#2408) 2024-10-28 19:24:36 +01:00
Martin Geisler
905784e601
Remove open-ended Android exercise (#2418)
Despite good intentions, I have not actually been able to make this
work in a classroom.

I suggest we remove it for now and later replace it with a guided
exercise: something where we ask students to write a AIDL client for a
simple system service.
2024-10-28 19:24:30 +01:00
Martin Geisler
6e829ff89a
Show expressions trees (#2425)
While giving the class, I noticed that a few people were not used to
this kind of recursive structures. A diagram could help here.
2024-10-28 19:24:22 +01:00
Võ Hoàng Long
8873e3ea53
vi: translate Default trait (#2447)
Translate the `Default` chapter of the `std-trait` section to Vietnamese
2024-10-27 13:47:59 -04:00
Martin Geisler
8bfff0d95a
Consistently inline formatting arguments (#2413) 2024-10-21 20:01:21 +02:00
Martin Geisler
ce56ea551e
Use both break and continue for consistency (#2412)
To me, this little change makes it a little clearer that we either
print something, we break, or we continue in the loop.
2024-10-21 19:57:19 +02:00
Martin Geisler
ec6cb024e8
Apply clippy::semicolon_if_nothing_returned (#2410)
This is for consistency: if a block returns `()`, and the last
expression of the block also returns `()`, then the final `;` can be
left out.

However, this is a little confusing (I was asked about this in a class
today) and it is inconsistent.

See

https://rust-lang.github.io/rust-clippy/master/index.html#/semicolon_if_nothing_returned
for details.
2024-10-21 19:57:01 +02:00
Danny Ra
3d1339c546
fa: fix translations.md restore sentence paragraph. (#2446)
fix: translations.md restore sentence paragraph.

---------

Co-authored-by: javad-jafari <javajafarifromsharak@gmail.com>
Co-authored-by: javad-jafari <65780584+javad-jafari@users.noreply.github.com>
2024-10-19 22:03:57 +03:30
Martin Geisler
e5d73d915b
Format filenames consistently (#2415)
The style used in the rest of the course is _italic_ filenames, so we
should be careful to not suddenly use **bold** names.

The style is of course up for debate, but we need to ensure
consistency first.
2024-10-18 12:29:31 +02:00
Martin Geisler
ab78a9e6b8
Links in channel pages (#2441) 2024-10-18 09:05:01 +02:00
Martin Geisler
ad7ef2e50a
Make scoped thread examples consistent (#2444)
This is a followup to #1020.
2024-10-18 09:04:44 +02:00
Martin Geisler
1a9941b39f
Put “Bye!” message on its own line (#2431)
Before the message would be printed right next to the text echoed
back. We now make sure to print it after a blank line.
2024-10-18 09:04:19 +02:00
Martin Geisler
0f00434a0f
Simplify language on mutex page (#2440)
The “iff” phrasing has confused people in the past.
2024-10-18 09:04:10 +02:00
Martin Geisler
fb17791c26
Remove misplaced extern "C" (#2429)
I think something changed: I now get a compilation error with these
lines (and it works fine without).
2024-10-18 09:03:54 +02:00
Martin Geisler
466233d959
Fix inclusion of PhoneNumber in exercise (#2426)
The anchor used the wrong name. This was not caught by our tests
because the code isn’t expected to compile, even when this is
included.
2024-10-18 09:03:48 +02:00
Martin Geisler
47c3d50542
Simplify language, add links, formatting fixes (#2443)
- Avoid time-specific statements (“recently”, “today”, …).

- Move details such as “RPIT” to the speaker notes.

- More links to our slides as well as community documentation.

- Formatting fixes
2024-10-18 09:03:17 +02:00
Martin Geisler
5d292377a0
Remove outdated note about showing type of future (#2442)
Modern Rust just says “note: calling an async function returns a
future” and hides the `Future` type.
2024-10-18 09:02:53 +02:00
Martin Geisler
0afca2f69b
Formatting in threads (#2439) 2024-10-18 09:02:45 +02:00
Younies Mahmoud
2552776288
ar: First Stage: Initial 5000 Lines Translated (#2322) 2024-10-17 15:53:31 +02:00
Martin Geisler
36a592df28
Mention https://std.rs/ and rustup doc (#2421)
These are convenient short-cuts for going to the standard library
documentation.
2024-10-17 02:53:02 -04:00
Danny Ra
4096bf89ae
fa: update fuzzy and untranslated part 1 (#2438)
fa: update fuzzy and untranslated part 1

---------

Co-authored-by: javad-jafari <javajafarifromsharak@gmail.com>
Co-authored-by: javad-jafari <65780584+javad-jafari@users.noreply.github.com>
2024-10-17 01:12:23 +03:30
Henri F.
f1423eaa72
Fix broken link on translations.md (#2437) 2024-10-16 14:50:13 -04:00
Martin Geisler
09a072b1ce
Point out new code in Luhn exercise solution (#2409)
This makes it easier for the students to understand where the changes
and thus fixes are.
2024-10-16 11:35:27 +02:00
Martin Geisler
0c824ab740
Fix “incorrect” which should have been “unsafe” (#2419) 2024-10-16 11:34:53 +02:00
Martin Geisler
701589ffd5
Consistently end list items with a full stop (#2416)
This is more consistent.
2024-10-16 11:34:22 +02:00
Martin Geisler
bd7b7eb121
Clean up duplicate heading (#2424) 2024-10-16 11:28:43 +02:00
Martin Geisler
4c78c3be6d
Simplify with local variable (#2423)
This reduces the vertical space needed.
2024-10-16 11:28:30 +02:00
Martin Geisler
dcdf3915ec
Fix typo in expect message (#2420) 2024-10-16 11:28:25 +02:00
Martin Geisler
1c3e4648e4
Remove unnecessary null check in FFI exercise (#2432)
We only assign `self.dir` once and we only assign it if the pointer is
non-null. We can therefore simplify the drop implementation a little.
2024-10-16 11:25:22 +02:00
Henri F.
28b5b559b3
fa: Adds Farsi to the language selector (#2436)
Adds Farsi to the drop-down language selector and minor rearrangement on
Translation page
#671
2024-10-15 22:17:55 -07:00
Dustin J. Mitchell
d9e3ad9e63
Reduce references to niche optimization (#2385)
Niche optimization is currently mentioned in three places:
 - Enums (User-Defined Types, Day 1 Afternoon)
 - Option (Standard Library Types, Day 2 Afternoon)
 - Box (Smart Pointers, Day 3 Morning)

This is a tricky thing to get right, and it was just in the speaker
notes in each place. #1820 will introduce a fuller explanation.

Fixes #1820.
2024-10-15 11:19:37 -04:00
Martin Geisler
a699430741
Remove unused Concurrency exercises page (#2411)
This was moved to the `concurrency/` directory.
2024-10-15 16:15:38 +02:00
Martin Geisler
a1b483a2f5
Call out that self receivers are covered later (#2422)
We have not formally introduced ownership at this point, so the
exercise can be confusing for students.

Alternatively, we could consider removing the `finish` method since
it’s not essential for a first encounter with methods.
2024-10-15 16:15:12 +02:00
Martin Geisler
a387b2c755
Simplify iterator method chaining exercise (#2427)
The exercise is about iterators, _not_ generic integer types. The
`where` syntax has also not been introduced before, further adding
confusion for the students.
2024-10-15 16:14:50 +02:00