1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-06-16 14:17:34 +02:00
Commit Graph

2289 Commits

Author SHA1 Message Date
8e90d761e1 vi: Control flow basics summary (#2074) 2024-06-30 18:31:45 -07:00
e5172dc6d6 vi: Translate the std library Vector, HashMap type and exercise (#2058)
Translate the rest of Rust standard library types section to Vietnamese
2024-06-30 18:15:15 -07:00
945b1ff043 uk: finalizing translation (#2176)
uk: finalizing translation

Signed-off-by: Andriy Redko <drreta@gmail.com>
2024-06-28 14:18:24 +01:00
b1a0287ec5 Fix name of trait for embedded-hal 1.0 and add missing import (#2174) 2024-06-26 09:55:11 -04:00
31d1182831 Update the link to the first dining philosophers exercise (#2153)
The current one leads to the same page.

https://google.github.io/comprehensive-rust/concurrency/async-exercises/dining-philosophers.html
2024-06-25 13:50:20 +00:00
2641370f34 Update index.md with language selection instructions and translations link (#2131) 2024-06-25 09:45:04 -04:00
2de95fa2de Fix publish workflow (#2171)
Need to `apt-get update` before `apt-get install`.
2024-06-25 09:42:16 -04:00
f496303f2c Add missing word (#2172) 2024-06-25 09:40:56 -04:00
71d31410ed cargo: bump cc from 1.0.99 to 1.0.100 in /src/bare-metal/aps/examples in the patch group (#2157)
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.99 to 1.0.100

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-25 10:21:24 +00:00
16bafaf635 cargo: bump microbit-v2 from 0.14.0 to 0.15.0 in /src/bare-metal/microcontrollers/examples in the minor group (#2158)
Bumps the minor group in /src/bare-metal/microcontrollers/examples with
1 update: [microbit-v2](https://github.com/nrf-rs/microbit).

Updates `microbit-v2` from 0.14.0 to 0.15.0

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-25 10:20:20 +00:00
52e8795d15 cargo: bump lazy_static from 1.4.0 to 1.5.0 in the minor group (#2160)
Bumps the minor group with 1 update:
[lazy_static](https://github.com/rust-lang-nursery/lazy-static.rs).

Updates `lazy_static` from 1.4.0 to 1.5.0

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-25 10:19:18 +00:00
d490d08f9d cargo: bump the minor group across 1 directory with 2 updates (#2169)
Bumps the minor group with 2 updates in the
/src/exercises/bare-metal/compass directory:
[lsm303agr](https://github.com/eldruin/lsm303agr-rs) and
[microbit-v2](https://github.com/nrf-rs/microbit).

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-25 11:13:47 +01:00
675493cb26 cargo: bump cc from 1.0.99 to 1.0.100 in /src/exercises/bare-metal/rtc in the patch group (#2156)
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.99 to 1.0.100

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-25 10:07:16 +00:00
45e4b167e9 cargo: bump the patch group across 1 directory with 2 updates (#2170)
Bumps the patch group with 2 updates in the / directory:
[serde_json](https://github.com/serde-rs/json) and
[reqwest](https://github.com/seanmonstar/reqwest).

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-25 10:50:39 +01:00
c7425f91c4 build(deps): bump crate-ci/typos from 1.22.7 to 1.22.9 (#2162)
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.22.7 to
1.22.9.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-25 10:48:20 +01:00
08bb2cf89a Update installation instructions for cargo-embed (#2167) 2024-06-25 08:57:41 +00:00
ab5e9006ef Use stable rustfmt (#2168)
This uses the `rustfmt` from the stable toolchain, instead of nightly.
At the moment, nightly's `rustfmt` is nonfunctional, but in general we
don't need bleeding-edge formatting (and in fact, the more often
formatting changes, the more often we'll get spurious failures on PRs,
as we are today).

Fixes #2165.
2024-06-25 09:07:15 +01:00
1fb284640e Add a map_err in speaker notes (#2155)
The type returned by `String::from_utf8(raw)`, is `Result<_>` and needs
to be mapped to match the type of the return type of `next`. You get
this error otherwise:

```
    Compiling playground v0.0.1 (/playground)
warning: unused import: `ErrorKind`
 --> src/main.rs:1:21
  |
1 | use std::io::{self, ErrorKind};
  |                     ^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

error[E0308]: mismatched types
   --> src/main.rs:29:17
    |
29  |         Ok(Some(s))
    |            ---- ^ expected `String`, found `Result<String, FromUtf8Error>`
    |            |
    |            arguments to this enum variant are incorrect
    |
    = note: expected struct `String`
                 found enum `Result<String, FromUtf8Error>`
help: the type constructed contains `Result<String, FromUtf8Error>` due to the type of the argument passed
   --> src/main.rs:29:12
    |
29  |         Ok(Some(s))
    |            ^^^^^-^
    |                 |
    |                 this argument influences the type of `Some`
note: tuple variant defined here
   --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:579:5
    |
579 |     Some(#[stable(feature = "rust1", since = "1.0.0")] T),
    |     ^^^^
help: use the `?` operator to extract the `Result<String, FromUtf8Error>` value, propagating a `Result::Err` value to the caller
    |
29  |         Ok(Some(s?))
    |                  +

For more information about this error, try `rustc --explain E0308`.
warning: `playground` (bin "playground") generated 1 warning
error: could not compile `playground` (bin "playground") due to 1 previous error; 1 warning emitted
```
2024-06-24 09:57:00 -04:00
9692d822db ja: cr2 Bare Metal translation (#1907)
Professional translations for CR2 content.
Changes are being staged in a separate branch until all Japanese content
is reviewed.

#1463 #652

---------

Co-authored-by: Hidenori Kobayashi <hidenorik@chromium.org>
2024-06-20 07:00:03 -07:00
543a47482a uk: post-refresh translation fixes (#2152)
uk: post-refresh translation fixes (follow up on
https://github.com/google/comprehensive-rust/pull/2148)

Signed-off-by: Andriy Redko <drreta@gmail.com>
2024-06-19 11:13:32 +01:00
043645c90a cargo: bump the patch group with 3 updates (#2150)
Bumps the patch group with 3 updates:
[clap](https://github.com/clap-rs/clap),
[cxx](https://github.com/dtolnay/cxx) and
[cxx-build](https://github.com/dtolnay/cxx).
2024-06-17 09:36:18 -04:00
32b5a19684 Update broken "channels" link (#2146)
Stumbled upon another broken link. Courtesy fix 🫡
2024-06-17 09:19:00 -04:00
a89a4d70ca build(deps): bump crate-ci/typos from 1.22.3 to 1.22.7 (#2149)
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.22.3 to
1.22.7.
2024-06-17 09:10:02 -04:00
4ac1cdca76 uk: refresh translations (#2148)
uk: refresh translations

```
MDBOOK_OUTPUT='{"xgettext": {"pot-file": "messages.pot", "granularity": 0}}'   mdbook build -d po
msgmerge --update po/uk.po po/messages.pot
```

Signed-off-by: Andriy Redko <drreta@gmail.com>
2024-06-17 10:55:21 +01:00
e3f153a6a0 Add VSCode config directory to .gitignore (#2147) 2024-06-16 21:04:06 +01:00
eecb4f0276 Add Google's Project IDX files to .gitignore (#2145)
Add [Project IDX](https://idx.dev/) files to `.gitignore`
2024-06-14 21:33:25 -07:00
1723baee47 Update generic-traits.md (#2142)
Fix a typo.
2024-06-13 12:18:45 -04:00
d2f8fc4ac5 Fix: Click anywhere on the language switch menu to switch the language (#2144)
close: https://github.com/google/comprehensive-rust/issues/2132
2024-06-13 12:17:26 -04:00
e70de3eb27 fa: refresh translation for Jun 2024 (#2128)
Updating `fa.po` translations based on the latest changes. If we merge
this before the #2038, it's easier to review that merge request.

Related to #671.

Co-authored-by: Mehrad Rousta <mehrad@protonmail.com>
2024-06-13 12:13:16 +03:30
f531554086 vi: Translate the std library String type (#2052) 2024-06-10 19:38:35 -07:00
b57319bb20 vi: control-flow-basics/macros.md translations (#2111) 2024-06-10 22:11:43 -04:00
26e1d77b3e Add note about !Sync (#2138)
This is key to the validity of how Cell and RefCell allow safe interior
mutability.
2024-06-10 15:35:13 +01:00
c45b291851 Clarify what "undefined behavior" means in arithmetic.md (#2139)
Undefined behavior does not just mean that the behavior can be different
on different platforms. It is much worse than that: the runtime behavior
can be completely nonsensical since the whole program has undefined
behavior.

The compiler will optimizer as if there is no undefined behavior and
will can lead to strange situations as the compiler concludes that
things like `a > a + 1000` can never be reached if `a` is a signed 8-bit
value (since reaching it would trigger undefined behavior).
2024-06-10 10:18:25 -04:00
4c61cafda8 Fix missing full stop in benefits.md (#2140) 2024-06-10 10:16:10 -04:00
6c5287c447 uk: Glossary and Credits (#2133)
Glossary and Credits

Signed-off-by: Andriy Redko <drreta@gmail.com>
2024-06-10 10:56:30 +01:00
6b17ce7125 cargo: bump the patch group with 4 updates (#2137)
Bumps the patch group with 4 updates:
[clap](https://github.com/clap-rs/clap),
[regex](https://github.com/rust-lang/regex),
[cxx](https://github.com/dtolnay/cxx) and
[cxx-build](https://github.com/dtolnay/cxx).

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-10 09:39:27 +01:00
742df51d23 cargo: bump cc from 1.0.98 to 1.0.99 in /src/bare-metal/aps/examples in the patch group (#2136)
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.98 to 1.0.99

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-10 09:38:59 +01:00
f71935e0cc cargo: bump cc from 1.0.98 to 1.0.99 in /src/exercises/bare-metal/rtc in the patch group (#2135)
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.98 to 1.0.99

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-10 09:38:36 +01:00
53daee6993 build(deps): bump crate-ci/typos from 1.21.0 to 1.22.3 (#2134)
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.21.0 to
1.22.3.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-10 09:38:06 +01:00
412eac6689 Clarify the suggested steps in the pin page (#2130)
The speaker notes suggest an evolution of the code to support a periodic
timer, but the last step was under-specified.

(As mentioned by @fw-immunant and referenced in #1536)
2024-06-07 16:39:14 -04:00
b69b68f5e2 Remove error handling from protobuf exercise (#2109) 2024-06-07 09:13:11 -07:00
511e5f0dbf Add slide about Result to error handling section (#2123) 2024-06-07 09:12:51 -07:00
fbeda7216b Adjust timing of standard library slides (#2125) 2024-06-07 09:11:57 -07:00
7c48cacf82 Fix dead link in glossary (#2114)
Fixes #2110. I think `references/strings.html` is a better choice as it
covers both String and &str.
2024-06-05 10:21:32 -04:00
a4d80d3ba0 uk: Concurrency (afternoon) (#2117)
uk: Concurrency (afternoon)

Signed-off-by: Andriy Redko <drreta@gmail.com>
2024-06-04 11:10:16 +01:00
5f72514f04 Fix closing details tag (#2116) 2024-06-03 10:54:40 -04:00
5f4ff0ab09 List expressions which are actually explained on this page (#2115)
`match` expressions were explained on an earlier page.
2024-06-03 10:54:16 -04:00
d09041fb91 cargo: bump tokio from 1.37.0 to 1.38.0 in the minor group (#2113)
Bumps the minor group with 1 update:
[tokio](https://github.com/tokio-rs/tokio).

Updates `tokio` from 1.37.0 to 1.38.0

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-03 10:43:11 +01:00
7d889d3248 ja: Merge CR v.2 Japanese translation back into main (#2103)
This PR merges the Japanese (ja) v.2 translation back to main.
This requires just a syntactical review, as the partial PRs into this
branch were reviewed already.

You can skim this PR with the [GitHub CLI](https://cli.github.com/):

gh pr diff 2103 | bat -l patch

#1463 #652

---------

Co-authored-by: Kanta Yamaoka (山岡幹太) <49053649+kantasv@users.noreply.github.com>
Co-authored-by: Hidenori Kobayashi <hidenorik@chromium.org>
2024-05-31 10:58:06 -07:00
59bf3bdcfb Add a slide introducing dyn Trait in Generics (#2108)
I've been thinking it'd be simpler to introduce `dyn Trait` via `&dyn
Trait` rather than waiting for the smart pointers section and `Box<dyn
Trait>`. This PR adds a slide to the Generics section that introduces
`&dyn Trait` and compares it to `&impl Trait`, juxtaposing
monomorphization and static dispatch against type-erasure and dynamic
dispatch. I've then updated the existing trait object slide to call back
to the earlier introduction, and call out that using `Box<dyn Trait>`
gives you an owned trait object rather than a borrowed one.
2024-05-31 09:59:36 -04:00