1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-03-20 06:21:09 +02:00

1168 Commits

Author SHA1 Message Date
tomf
26979c9542
Move const before static (#2305)
Motivation:
* const usecases are likely more familiar than static usecases
* currently the static slide refers `const`, before it's introduced

Background: static and const were previously on the same slide, with
const being introduced first (
https://github.com/google/comprehensive-rust/pull/1881 ) but when they
were split, static was moved first.
2024-08-23 18:48:57 +00:00
Alix
3edec36fab
add Farsi to Incomplete Translations (#2269) 2024-08-21 07:58:09 +00:00
Jason Lin
958bfe58c5
Update shared.md (#2292) 2024-08-21 06:34:08 +00:00
Jason Lin
590a88fc3d
update break-continue.md (#2287)
Move the speak note about "loop" into the page which we actually talk
about "loop". Also update the wording to make it more accurate.

---------

Co-authored-by: Jason Lin <lxj@google.com>
2024-08-21 06:33:50 +00:00
dependabot[bot]
3ecf12123b
cargo: bump the minor group with 2 updates (#2290)
Bumps the minor group with 2 updates:
[pulldown-cmark](https://github.com/raphlinus/pulldown-cmark) and
[googletest](https://github.com/google/googletest-rust).
2024-08-20 16:46:56 +01:00
Frances Wingerter
aa0201ccfd
interior-mutability.md: swap Cell/RefCell order and improve explanation (#2278)
Fixes #2249.
2024-08-20 11:26:23 -04:00
Jason Lin
4012e2a883
Update if.md (#2286)
The original phrasing may imply that you have to always terminated a
`if` expression with `;`. But the real reason that we have to do that is
because we are using it in a `let` statement here, and `let` statement
has to be terminated by `;`

---------

Co-authored-by: Martin Geisler <martin@geisler.net>
2024-08-20 08:15:39 +00:00
Jason Lin
127202d591
Update trait-bounds.md (#2295)
We are going to talk about `impl Trait` in the very next slide. Let's
don't duplicate it here and complicate the flow?
2024-08-20 08:08:32 +00:00
dependabot[bot]
56ae649097
cargo: bump the patch group with 6 updates (#2291)
Bumps the patch group with 6 updates:

| Package | From | To |
| --- | --- | --- |
| [clap](https://github.com/clap-rs/clap) | `4.5.15` | `4.5.16` |
| [serde](https://github.com/serde-rs/serde) | `1.0.206` | `1.0.208` |
| [serde_json](https://github.com/serde-rs/json) | `1.0.124` | `1.0.125`
|
| [tokio](https://github.com/tokio-rs/tokio) | `1.39.2` | `1.39.3` |
| [cxx](https://github.com/dtolnay/cxx) | `1.0.124` | `1.0.126` |
| [cxx-build](https://github.com/dtolnay/cxx) | `1.0.124` | `1.0.126` |

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-19 12:14:42 +01:00
dependabot[bot]
64bf5534f7
cargo: bump cc from 1.1.10 to 1.1.13 in /src/bare-metal/aps/examples in the patch group (#2289)
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.10 to 1.1.13

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-19 12:12:43 +01:00
dependabot[bot]
82c97a091a
cargo: bump cc from 1.1.10 to 1.1.13 in /src/exercises/bare-metal/rtc in the patch group (#2288)
Bumps the patch group in /src/exercises/bare-metal/rtc with 1 update:
[cc](https://github.com/rust-lang/cc-rs).

Updates `cc` from 1.1.10 to 1.1.13

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-19 12:12:25 +01:00
Frances Wingerter
dfd08ebf93
concurrency: avoid 1.. loops (#2280)
Fixes #2060. Note that this does not change the "blocking executor"
example because on that slide it is worthwhile to sleep for 1 * 10ms on
the first iteration and so on. But we shouldn't use one-indexed
inclusive loops when the only significant feature of the loop is its
iteration count.
2024-08-13 14:38:22 +00:00
Frances Wingerter
e9fce0417e
box.md: clarify that box provides needed indirection (#2283)
The last to-do for #64.
2024-08-13 14:29:11 +00:00
Frances Wingerter
3b349d830c
from-and-into.md: mention losslessness and infallibility (#2281)
Fixes #2069.
2024-08-13 14:28:22 +00:00
Frances Wingerter
991bd8ceb7
threads: do not refer to "daemon" threads (#2282)
This is the last remaining fix left from #63.
2024-08-13 14:28:08 +00:00
Frances Wingerter
f6a3c07ea3
operators.md: mention Not trait's un-C-like behavior (#2279)
Fixes #2072.
2024-08-13 14:27:49 +00:00
Frances Wingerter
fa6055c297
break/continue: don't say "for loop" (#2277)
See #2042.
2024-08-13 14:27:08 +00:00
Frances Wingerter
6d743dac5a
Change let-else example to demonstrate undesirable nesting (#2276)
Fixes #2070.

Previously we showed a forcibly de-nested version using both let and
if-let. this is not a construction that new learners of Rust are likely
to have seen or written, while nesting if-let is closer to patterns that
appear in other languages and better motivates the de-nesting
transformation to let-else
2024-08-13 14:26:52 +00:00
dependabot[bot]
da9f57a462
cargo: bump cc from 1.1.7 to 1.1.10 in /src/bare-metal/aps/examples in the patch group (#2272)
Bumps the patch group in /src/bare-metal/aps/examples with 1 update:
[cc](https://github.com/rust-lang/cc-rs).
2024-08-12 10:58:59 -04:00
dependabot[bot]
a3838975b6
cargo: bump the minor group with 2 updates (#2273)
Bumps the minor group with 2 updates:
[scraper](https://github.com/causal-agent/scraper) and
[tempfile](https://github.com/Stebalien/tempfile).
2024-08-12 10:58:35 -04:00
dependabot[bot]
a4daeca3ad
cargo: bump microbit-v2 from 0.15.0 to 0.15.1 in /src/bare-metal/microcontrollers/examples in the patch group (#2275)
Bumps the patch group in /src/bare-metal/microcontrollers/examples with
1 update: [microbit-v2](https://github.com/nrf-rs/microbit).
2024-08-12 10:57:21 -04:00
dependabot[bot]
cda5d6c71b
cargo: bump the patch group in /src/exercises/bare-metal/rtc with 2 updates (#2271)
Bumps the patch group in /src/exercises/bare-metal/rtc with 2 updates:
[arm-gic](https://github.com/google/arm-gic) and
[cc](https://github.com/rust-lang/cc-rs).
2024-08-12 10:56:43 -04:00
dependabot[bot]
37738ff199
cargo: bump microbit-v2 from 0.15.0 to 0.15.1 in /src/exercises/bare-metal/compass in the patch group (#2270)
Bumps the patch group in /src/exercises/bare-metal/compass with 1
update: [microbit-v2](https://github.com/nrf-rs/microbit).
2024-08-12 10:56:06 -04:00
Dustin J. Mitchell
76857d76a1
Simplify the select! example (#2154)
@mgeisler PTAL, as I believe you were the one to suggest this change in
#1536.

This leaves some detail about `select!` out, but that might be just as
well. Some of that detail is addressed in the `pin!` pitfall, later.
2024-08-09 08:21:00 -04:00
Luca Palmieri
697df5599e
Update "Rust advanced testing" links to point at the hosted book version (#2265)
Following up on @mgeisler's comment in
https://github.com/google/comprehensive-rust/pull/2029
2024-08-05 14:11:24 +00:00
dependabot[bot]
9894e4a705
cargo: bump cc from 1.1.6 to 1.1.7 in /src/exercises/bare-metal/rtc in the patch group (#2263)
Bumps the patch group in /src/exercises/bare-metal/rtc with 1 update:
[cc](https://github.com/rust-lang/cc-rs).

Updates `cc` from 1.1.6 to 1.1.7

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-05 11:30:36 +01:00
dependabot[bot]
b3ab07e692
cargo: bump cc from 1.1.6 to 1.1.7 in /src/bare-metal/aps/examples in the patch group (#2260)
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.6 to 1.1.7

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-05 11:29:47 +01:00
dependabot[bot]
d163e5a603
cargo: bump the minor group with 3 updates (#2261)
Bumps the minor group with 3 updates:
[tempfile](https://github.com/Stebalien/tempfile),
[tokio](https://github.com/tokio-rs/tokio) and
[tokio-websockets](https://github.com/Gelbpunkt/tokio-websockets).

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-08-05 11:24:26 +01:00
Jonathan Daniel
4c28a9253b
Set Rust caching key per language group (#2250)
Fixes #2247 (a follow-up from #2195).

* Add a workflow dispatch manual trigger to the tests workflow.
* Move the link-checked languages JSON list to the build job's env.
* Set a caching key per language group to avoid extra `mdbook-linkcheck`
installation on non-link-checked translations.
  For the meaning of this key, see:
https://github.com/Swatinem/rust-cache?tab=readme-ov-file#example-usage
* Fix newly broken web link in 8a3ed21  

I tested it on my fork, and it looks good:
https://github.com/jond01/comprehensive-rust/actions/workflows/build.yml
https://github.com/jond01/comprehensive-rust/actions/caches
2024-07-29 10:28:12 +01:00
Jonathan Daniel
1c964f6fe3
Fix a broken link and check internal links (#2195)
In #2153 I aimed to fix a link but broke it.
In this PR, I fix it and add
[`mdbook-linkcheck`](https://github.com/Michael-F-Bryan/mdbook-linkcheck)
to avoid future cases.

Some past fixes that could have been prevented, in addition to mine in
this PR:
* #811
* #2064
* #2146

Note:  
`mdbook-linkcheck` may also check external links with a configuration
change.
It can be beneficial to check also external links from time to time. I
ran it here and found 3 broken links.

Maintainers - sorry for the lack of a preceding issue. We can discuss it
here.
Some remaining work is to fix the outdated internal links in the
translations, not done here.
Let me know what you think about the proposed contribution.

This PR completes #1502.
2024-07-22 11:37:19 +00:00
Kamil Panek
16c4724300
Fix comma position (#2233)
Co-authored-by: Kamil Panek <panek.kam@gmail.com>
2024-07-22 13:29:13 +02:00
dependabot[bot]
1e1854557d
cargo: bump cc from 1.1.4 to 1.1.6 in /src/exercises/bare-metal/rtc in the patch group (#2243)
Bumps the patch group in /src/exercises/bare-metal/rtc with 1 update:
[cc](https://github.com/rust-lang/cc-rs).

Updates `cc` from 1.1.4 to 1.1.6

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-22 11:15:13 +01:00
dependabot[bot]
1c32e05bb6
cargo: bump cc from 1.1.4 to 1.1.6 in /src/bare-metal/aps/examples in the patch group (#2242)
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.4 to 1.1.6

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-22 10:14:54 +00:00
dependabot[bot]
a4ea10f8a1
cargo: bump mockall from 0.12.1 to 0.13.0 in the minor group (#2240)
Bumps the minor group with 1 update:
[mockall](https://github.com/asomers/mockall).

Updates `mockall` from 0.12.1 to 0.13.0
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/asomers/mockall/blob/master/CHANGELOG.md">mockall's
changelog</a>.</em></p>
<blockquote>
<h1>Change Log</h1>
<p>All notable changes to this project will be documented in this file.
This project adheres to <a href="http://semver.org/">Semantic
Versioning</a>.</p>
<h2>[ Unreleased ] - ReleaseDate</h2>
<h3>Added</h3>
<ul>
<li>
<p>Add the ability to use <code>#[concretize]</code> with methods that
have an <code>FnMut</code>
argument.
(<a
href="https://redirect.github.com/asomers/mockall/pull/595">#595</a>)</p>
</li>
<li>
<p>Add the ability to mock methods that use <code>#[auto_enum]</code>,
from the
<code>auto_enums</code> crate. But only for methods that use RPIT;
Mockall can't yet
handle syntax like <code>-&gt; Result&lt;(), impl T&gt;</code>
(<a
href="https://redirect.github.com/asomers/mockall/pull/590">#590</a>)</p>
</li>
<li>
<p>Add the ability to mock methods that use <code>#[inline]</code> or
<code>#[cold]</code>, and
methods or traits that use <code>#[must_use]</code>.
(<a
href="https://redirect.github.com/asomers/mockall/pull/555">#555</a>)</p>
</li>
</ul>
<h3>Changed</h3>
<ul>
<li>
<p>Raised MSRV to 1.71.0 due to the <code>C-unwind</code> ABI.
(<a
href="https://redirect.github.com/asomers/mockall/pull/585">#585</a>)</p>
</li>
<li>
<p>No longer poison a Context object's internal <code>Mutex</code> when
panicing. This
requires the &quot;nightly&quot; feature.
(<a
href="https://redirect.github.com/asomers/mockall/pull/527">#527</a>)</p>
</li>
</ul>
<h3>Fixed</h3>
<ul>
<li>Fixed panicing within mocked <code>extern &quot;C&quot;</code>
functions, for example due to
unsatisfied expectations, with Rust 1.81.0 or newer.
(<a
href="https://redirect.github.com/asomers/mockall/pull/585">#585</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/asomers/mockall/commits">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=mockall&package-manager=cargo&previous-version=0.12.1&new-version=0.13.0)](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-07-22 11:14:04 +01:00
dependabot[bot]
0f7ab8fc7f
cargo: bump the patch group with 3 updates (#2241)
Bumps the patch group with 3 updates:
[thiserror](https://github.com/dtolnay/thiserror),
[scraper](https://github.com/causal-agent/scraper) and
[tokio](https://github.com/tokio-rs/tokio).
2024-07-22 00:48:37 -04:00
dependabot[bot]
80791ba59d
cargo: bump the patch group with 2 updates (#2229)
Bumps the patch group with 2 updates:
[clap](https://github.com/clap-rs/clap) and
[thiserror](https://github.com/dtolnay/thiserror).

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-15 10:32:46 +01:00
dependabot[bot]
6561739fd0
cargo: bump cc from 1.0.105 to 1.1.4 in /src/bare-metal/aps/examples in the minor group (#2228)
Bumps the minor group in /src/bare-metal/aps/examples with 1 update:
[cc](https://github.com/rust-lang/cc-rs).

Updates `cc` from 1.0.105 to 1.1.4

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-15 10:32:17 +01:00
dependabot[bot]
827fa7e72f
cargo: bump cc from 1.0.105 to 1.1.4 in /src/exercises/bare-metal/rtc in the minor group (#2227)
Bumps the minor group in /src/exercises/bare-metal/rtc with 1 update:
[cc](https://github.com/rust-lang/cc-rs).

Updates `cc` from 1.0.105 to 1.1.4

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-15 10:31:53 +01:00
Andrew Walbran
19e0660505
Link to translation reports. (#2213)
Also explain how to generate the report locally.
2024-07-12 10:11:31 -04:00
Andrew Walbran
ec47ec2b5f
Update udev rule for microbit. (#2217)
The subsystem seems to have changed with a newer version of udev, and
using logindev and uaccess rather than plugdev is consistent with how
other similar devices are handled.
2024-07-12 12:27:26 +01:00
Jason Lin
5d69d8c87b
Remove lifetime trait bound on ProtoMessage (#2187)
The lifetime trait bound is unncessary, and the code compiles without
it.
2024-07-09 21:20:00 +00:00
Max Heller
550cc39ee4
fix </detail> typo (#2209) 2024-07-09 15:46:24 +00:00
Henri F
90acb23506
Fix a single typo on translations.md (#2206) 2024-07-09 10:26:38 +01:00
Henri F
23c30a9e39
Fix broken links to Arabic translation (#2204)
#445
2024-07-08 18:44:34 +00:00
dependabot[bot]
eeea2ec2ac
cargo: bump the patch group with 3 updates (#2201)
Bumps the patch group with 3 updates:
[serde](https://github.com/serde-rs/serde),
[serde_json](https://github.com/serde-rs/json) and
[zerocopy](https://github.com/google/zerocopy).

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-08 08:56:03 +01:00
dependabot[bot]
a95c9dd6d2
cargo: bump buddy_system_allocator from 0.9.1 to 0.10.0 in the minor group (#2200)
Bumps the minor group with 1 update:
[buddy_system_allocator](https://github.com/rcore-os/buddy_system_allocator).

Updates `buddy_system_allocator` from 0.9.1 to 0.10.0

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-08 08:55:08 +01:00
dependabot[bot]
2998282e73
cargo: bump cc from 1.0.103 to 1.0.105 in /src/exercises/bare-metal/rtc in the patch group (#2197)
Bumps the patch group in /src/exercises/bare-metal/rtc with 1 update:
[cc](https://github.com/rust-lang/cc-rs).

Updates `cc` from 1.0.103 to 1.0.105

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-08 08:54:42 +01:00
dependabot[bot]
9688fa993c
cargo: bump buddy_system_allocator from 0.9.1 to 0.10.0 in /src/bare-metal/alloc-example in the minor group (#2199)
Bumps the minor group in /src/bare-metal/alloc-example with 1 update:
[buddy_system_allocator](https://github.com/rcore-os/buddy_system_allocator).

Updates `buddy_system_allocator` from 0.9.1 to 0.10.0

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-08 08:53:21 +01:00
dependabot[bot]
104abced36
cargo: bump cc from 1.0.103 to 1.0.105 in /src/bare-metal/aps/examples in the patch group (#2198)
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.0.103 to 1.0.105

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-08 08:52:51 +01:00
Younies Mahmoud
a976603da5
First step in Arabic Translation (#2193)
Part of : #445
2024-07-05 22:40:03 -07:00