1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2024-12-12 21:29:59 +02:00
Commit Graph

1796 Commits

Author SHA1 Message Date
dependabot[bot]
3cd28c3404
cargo: bump the patch group with 2 updates (#2056)
Bumps the patch group with 2 updates:
[serde](https://github.com/serde-rs/serde) and
[zerocopy](https://github.com/google/zerocopy).
2024-05-06 09:35:18 -04:00
dependabot[bot]
43f910aa41
build(deps): bump crate-ci/typos from 1.20.10 to 1.21.0 (#2055)
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.20.10
to 1.21.0.
2024-05-06 09:34:29 -04:00
Huy Vuong
1ebe60fe15
vi: control-flow-basics/break-continue/...md + some SUMMARY.md translations (#2030) 2024-05-03 19:04:57 -04:00
Huy Vuong
bd0e652c40
vi: control-flow-basics/loops/...md translations (#2009) 2024-05-03 12:31:49 -04:00
Võ Hoàng Long
919bca91c0
Translate the std library summary, option, and result types into Vietnamese (#2040) 2024-05-03 12:20:56 -04:00
Minh Nguyen
4125e23b4a
vi: What is Rust? (#2003)
Here is the translation of ***What is Rust?***
2024-05-03 12:20:09 -04:00
Luca Palmieri
f2de222d66
Add links to the Rust advanced testing workshop (#2029)
Following up on https://github.com/google/googletest-rust/issues/376

---------

Co-authored-by: Martin Geisler <martin@geisler.net>
2024-05-03 08:20:02 +00:00
Manichand Kondapaka
48325a08fe
Updated struct and enums in pattern-matching. (#2021)
#1464 issue.

---------

Co-authored-by: Martin Geisler <martin@geisler.net>
2024-04-30 10:07:10 -04:00
1dimir
9a66fb1451
ru: translate navigation titles: days 3-4 (#2011)
* Translate new `msid`s related to navigation of days 3 and 4 sections;
* Rename to provide more context:
    * `Iterator` -> Типаж `Iterator`
    * `IntoIterator` -> Типаж `IntoIterator`
    * `FromIterator` -> Типаж `FromIterator`
* Rename: Функции -> Небезопасные функции (Unsafe Functions)
* Mention alternatives in translator's comments;
* Mark translations brought from the Rust book;

#326
2024-04-29 12:01:09 +01:00
dependabot[bot]
5c0ed8823f
cargo: bump the patch group with 2 updates (#2035)
Bumps the patch group with 2 updates:
[serde](https://github.com/serde-rs/serde) and
[pulldown-cmark](https://github.com/raphlinus/pulldown-cmark).

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-29 11:30:53 +01:00
dependabot[bot]
6f4f29e603
Bump crate-ci/typos from 1.20.9 to 1.20.10 (#2034)
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.20.9 to
1.20.10.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-29 11:30:19 +01:00
Chayim Refael Friedman
5633dd52a7
Vec::new() doesn't allocate (#2026)
So remove it from the list of things to look on that allocate, and
replace with `vec![]`, which does allocate (if given any elements).
2024-04-25 09:40:36 -04:00
Huy Vuong
402ac3a202
vi: control-flow-basics.md translations (#1983)
Doing a small translations and making sure that I am creating PRs
correctly

I leave `Macros` as-is because there isn't an actual translations for
`Macros` in Vietnamese. It looks like they just use `macros` directly in
any vietnamese docs

see:
* https://rust-tieng-viet.github.io/basic/macro/
* https://vi.linux-console.net/?p=28497#google_vignette
2024-04-24 16:01:51 +00:00
AdrienBaudemont
8bd2dd06f6
fr: translating remaining paragraphs in section 1 (#2010)
fr: translating remaining paragraphs in section 1. Adding self to French
translators.
2024-04-24 11:03:37 +02:00
Dustin J. Mitchell
face5af783
Update Concurrency course with times (#2007)
As I mentioned in #1536:

* Break into segments at approximately the places @fw-immunant put
breaks
 * Move all of the files into `src/concurrency`
 * Add timings and segment/session metadata so course outlines appear

There's room for more work here, including some additional feedback from
@fw-immunant after the session I observed, but let's do one step at a
time :)
2024-04-23 13:26:41 +00:00
dependabot[bot]
a03b7e68e5
cargo: bump cortex-m-rt from 0.7.3 to 0.7.4 in /src/exercises/bare-metal/compass in the patch group (#2019)
Bumps the patch group in /src/exercises/bare-metal/compass with 1
update: [cortex-m-rt](https://github.com/rust-embedded/cortex-m).

Updates `cortex-m-rt` from 0.7.3 to 0.7.4

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-22 10:28:39 +01:00
dependabot[bot]
1e772b7419
cargo: bump the patch group in /src/exercises/bare-metal/rtc with 2 updates (#2017)
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>
2024-04-22 10:28:10 +01:00
dependabot[bot]
94d9f66589
cargo: bump cc from 1.0.91 to 1.0.95 in /src/bare-metal/aps/examples in the patch group (#2014)
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.91 to 1.0.95

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-22 10:27:32 +01:00
dependabot[bot]
9ce4b4698f
cargo: bump the patch group with 4 updates (#2016)
Updates `serde` from 1.0.197 to 1.0.198

Updates `serde_json` from 1.0.115 to 1.0.116

Updates `thiserror` from 1.0.58 to 1.0.59

Updates `reqwest` from 0.12.3 to 0.12.4

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-22 09:18:08 +02:00
dependabot[bot]
17131d0b35
cargo: bump tokio-websockets from 0.7.0 to 0.8.2 in the minor group (#2015)
Updates `tokio-websockets` from 0.7.0 to 0.8.2

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-22 09:15:16 +02:00
dependabot[bot]
4259b63c44
Bump crate-ci/typos from 1.20.8 to 1.20.9 (#2018)
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.20.8 to
1.20.9.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-22 09:14:00 +02:00
Nicole L
ea8b5d2207
Simplify interior mutability example (#2006)
The existing `RefCell` example code was more complex than necessary to
demonstrate the functionality, and was complex in a way that I often
found hard to explain to students. This PR replaces it with a much
simpler demonstration, and adds a code example for `Cell`.
2024-04-19 10:21:30 -04:00
Nicole L
0c23d817e5
Add examples of the borrow checker catching errors (#2000)
I think it'd be helpful to actually demonstrate to students how the
"sharing XOR mutability" rule actually prevents errors in practice,
since right now we explain the rule but don't give much context as to
why the rule is important.
2024-04-19 10:19:06 -04:00
Nicole L
59d63a6e89
Simplify the example code for Clone (#2001)
The previous example code for the `Clone` slide was a bit too complex in
a way that obscured the fundamental point. I've replaced it with the
`say_hello` example from the previous slide, but updated to demonstrate
how cloning can address the borrow checker error. I also added a speaker
note to mention that `Clone` performs a deep copy, which might be
different from what students are used to if they come from a language
like Python that does shallow copies by default.
2024-04-19 10:18:31 -04:00
Dustin J. Mitchell
bb44b1d7a8
Use tables to summarize course content (#2005)
This is more friendly to translation (as it can share the translation of
the title).

This fixes #1982.
2024-04-19 13:38:26 +00:00
Andrew Walbran
45aa43f406
Update to embedded-hal 1.0 (#1723)
Now that the new version of `microbit-v2` and friends are finally
released, we can use `embedded-hal` 1.0 for the bare metal morning.
2024-04-19 12:52:50 +01:00
Nicole L
c9e08fae60
Slightly simplify binary tree exercise (#2002)
Give students a little more context for the binary tree exercise by
giving them the wrapper methods on `BinaryTree` at the start and
explicitly asking them to implement the methods on `Subtree`. I think
this simplifies the exercise a bit and makes it a bit more focused for
students.
2024-04-18 14:50:27 -04:00
khoaxuantu
e6021ce5d0
vi: Day 1 Morning - Welcome translation (#1972)
The translation of *Day 1 Morning: Welcome*.
2024-04-18 11:24:55 -04:00
Caleb Maclennan
487d1710c9
Add @alerque as a reviewer for the Turkish translation (#1999)
See invitation here:
https://github.com/google/comprehensive-rust/pull/1971#issuecomment-2061199545

Also note that @enes1313 is marked as a code owner, but they are *not* a
collaborator on the repository so the code owner features are
non-functional and this is considered an error by the GH parser.
Obviously there are two possible resolutions to that...
2024-04-18 12:48:18 +02:00
Nicole L
bb47529cb9
Move generics to day 2 afternoon (#1976) 2024-04-17 16:24:49 -07:00
Enes Aydın
f1692ef5d9
tr: day 1 morning translation (#1971)
Translated day-1-morning
Part of #500
2024-04-17 14:00:24 +02:00
Martin Geisler
963c6979ed
Revert "Update README.md with mdbook-pandoc install" (#1998)
Reverts google/comprehensive-rust#1975

Using `mdbook-pandoc` requires more than just installing the `mdbook`
plugin: it requires

- A whole LaTeX installation
- A Pandoc installation
- Some fonts

This is essentially why the output is configured as optional in
`book.toml`: the assumption is that people won't have `mdbook-pandoc`
installed without the necessary supporting tools.

@henrif75, I assume you added this because you didn't like the warning
`mdbook build` prints:

```
% mdbook build
2024-04-16 10:45:56 [WARN] (mdbook::book): The output.html.curly-quotes field has been renamed to output.html.smart-punctuation.
Use the new name in book.toml to remove this warning.
2024-04-16 10:45:56 [INFO] (mdbook::book): Book building has started
2024-04-16 10:45:57 [INFO] (mdbook::book): Running the exerciser backend
2024-04-16 10:45:57 [INFO] (mdbook::renderer): Invoking the "exerciser" renderer
2024-04-16 10:45:57 [INFO] (mdbook::book): Running the html backend
2024-04-16 10:45:58 [INFO] (mdbook::book): Running the pandoc backend
2024-04-16 10:45:58 [INFO] (mdbook::renderer): Invoking the "pandoc" renderer
2024-04-16 10:45:58 [WARN] (mdbook::renderer): The command `mdbook-pandoc` for backend `pandoc` was not found, but was marked as optional.
```

I don't have the necessary dependencies on my local system and this is
what I get after installing `mdbook-pandoc`:

```
2024-04-16 10:47:30 [INFO] (mdbook::renderer): Invoking the "pandoc" renderer
Unable to run `pandoc -v`: No such file or directory (os error 2)
2024-04-16 10:47:30 [ERROR] (mdbook::renderer): Renderer exited with non-zero return code.
2024-04-16 10:47:30 [ERROR] (mdbook::utils): Error: Rendering failed
2024-04-16 10:47:30 [ERROR] (mdbook::utils): 	Caused By: The "pandoc" renderer failed
```

This also means that `mdbook serve` doesn't work unless all dependencies
are installed.

As an alternative, we could remove the `output.pandoc` settings from the
`book.toml` file and use a small shell script to add them when needed.

We actually have the same problem for the `mdbook-xgettext` output
format which generates the POT files: we only want to run this
occasionally. This is currently done by overriding `output` from the
command line using the `MDBOOK_OUTPUT` environment variable:

```shell
MDBOOK_OUTPUT='{"xgettext": {"pot-file": "messages.pot", "granularity": 0}}' \
  mdbook build -d po
```

It's a bit ugly and it results in people missing/forgetting some of the
configuration options we want them to use (the `granularity` setting).
So I would like to move this configuration to the `book.toml` file — but
I'm reluctant since I don't think we need to generate POT files on every
build (it takes ~1 second and would slow down `mdbook serve`).

Cc @max-heller in case you have ideas here.
2024-04-16 13:26:47 -07:00
1dimir
b76af9c710
ru: translate days 1-2 section titles (#1973)
* Add translations for the new extracted messages related to Day 1and
Day 2 chapters;
* Fix numbering in translation of Day 4 titles;
* Use PO file translator comments for notes and reasons why one or
another choice was made, mention alternatives;
* Do not translate type and trait names;
* Rename: Поток управления -> Управляющие конструкции;
* Rename: Перечисления и сопоставление с образцом. -> Деструктуризация;
* Rename: Ссылки -> Заимствование;
* Rename: Висячие ссылки -> Изменяемые ссылки;
* Rename: Вторая половина дня -> После обеда;
* Rename: Поток управления -> `Let` в потоке управления (src: Let
Control Flow);
* Rename: Функции -> Обобщённые функции (src: Generic Functions);
* Rename: Обобщения (generics). -> Обобщённые типажи (src: Generic
Traits);
* Cannot translate `Slices: &[T]` - possible bug

#326
2024-04-16 15:24:25 +01:00
Keiichi Watanabe
f103971cf4
Add @HidenoriKobayashi to CODEOWNERS for Japanese translation (#1997)
@HidenoriKobayashi has been working on Japanese translation very well so
it'd be nice to have him as a CODEOWNER
2024-04-16 14:11:34 +09:00
Jannis Imhof
cb59f30a2e
Fix Fibonacci sequence i.e. fib(0) -> 0. (#1996)
related Issue #1985
2024-04-15 20:07:44 +00:00
dependabot[bot]
0a1ddadc83
cargo: bump nrf52833-hal from 0.16.1 to 0.17.0 in /src/bare-metal/microcontrollers/examples in the minor group (#1989)
Bumps the minor group in /src/bare-metal/microcontrollers/examples with
1 update: [nrf52833-hal](https://github.com/nrf-rs/nrf-hal).

Updates `nrf52833-hal` from 0.16.1 to 0.17.0

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-04-15 15:51:46 +00:00
Iván Budnik
06a2683cc7
Add missing import for try-conversions.md example (#1986)
Uncommenting the "write" line causes the example to fail compilation
because the compiler can't find `fs`.
2024-04-15 11:04:27 -04:00
Dustin J. Mitchell
70916261ad
Exercise has a single function to implement (#1995)
Fixes #1993.
2024-04-15 10:37:59 -04:00
Andriy Redko
83e25e30ff
uk: Chromium development (#1984)
uk: Chromium development

Signed-off-by: Andriy Redko <drreta@gmail.com>
2024-04-15 11:00:20 +01:00
dependabot[bot]
956a1361f1
Bump crate-ci/typos from 1.20.4 to 1.20.8 (#1990)
Bumps [crate-ci/typos](https://github.com/crate-ci/typos) from 1.20.4 to
1.20.8.

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-15 10:25:43 +01:00
dependabot[bot]
029c8ac5ca
cargo: bump cc from 1.0.91 to 1.0.94 in /src/exercises/bare-metal/rtc in the patch group (#1988)
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.91 to 1.0.94

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-15 10:25:12 +01:00
dependabot[bot]
5df10096ac
cargo: bump the patch group with 3 updates (#1987)
Bumps the patch group with 3 updates:
[anyhow](https://github.com/dtolnay/anyhow),
[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-04-15 10:24:49 +01:00
Nicole L
a4d674b02e
Remove redundant trait bounds from counter exercise (#1980)
The trait bounds aren't needed on the struct definition, only the impl
block. I think it'd be useful to show the difference here in order to
show students how trait bounds for collection types are usually on the
impl blocks rather than the type itself.
2024-04-12 17:07:08 -04:00
Andrew Walbran
b808887006
Add safety comments and use consistent format for existing ones. (#1981)
We should have safety comments on all `unsafe` blocks, to set a good
example.
2024-04-12 13:19:19 -04:00
Nicole L
8433ad9a3d
Remove to_string from HashMap example (#1979)
While it's generally better in Rust code to use `String` as the key type
for a `HashMap` than `&str`, for the purposes of our examples having the
extra `to_string` calls makes the example more verbose and confusing for
students. The simple example will work as-is without the `to_string`
calls, so I think it's better to just remove them.
2024-04-12 13:17:20 -04:00
Nicole L
04c28ed641
Simplify if-let example (#1977)
I find that `if let` makes the most sense to use when you don't have an
`else` case, otherwise it's generally clearer to express the same thing
with a `match`. This changes the `if let` example to be (arguably) a bit
more idiomatic and less verbose.
2024-04-12 12:45:01 -04:00
Nicole L
d966750535
Uncomment setter in generics example (#1978)
I don't think it helps to have the example of a setter commented out in
the example. Uncommenting it and implementing it normally is more clear.
2024-04-12 11:15:46 -04:00
Henri F
80b214117e
Update README.md with mdbook-pandoc install (#1975) 2024-04-12 11:02:03 -04:00
Martin Geisler
9cc3e9c5ed
Avoid fixed byte offsets in strings.md (#1963)
As discovered during #1961, fixed byte offsets tend to break
translations because the translated strings can end up having a
character on the boundary where we slice.
2024-04-09 19:30:58 +02:00
AdrienBaudemont
9ba6c8f8df
fr: removing semi-deleted former translations. (#1970)
fr: removing semi-deleted former translations.
2024-04-09 19:30:45 +02:00