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
Manichand Kondapaka
e5e33a1159
Removed destructuring about struct (#1924)
#1464 issue . Let's limit this section to arrays and tuples.
Destructuring in structs explained in [Day-2
Morning]((https://google.github.io/comprehensive-rust/pattern-matching/destructuring.html)).
2024-03-19 16:49:26 -04:00
dependabot[bot]
3facea27d4
cargo: bump the patch group with 5 updates (#1926)
Bumps the patch group with 5 updates:

| Package | From | To |
| --- | --- | --- |
| [anyhow](https://github.com/dtolnay/anyhow) | `1.0.80` | `1.0.81` |
| [clap](https://github.com/clap-rs/clap) | `4.5.2` | `4.5.3` |
| [serde_yaml](https://github.com/dtolnay/serde-yaml) | `0.9.32` |
`0.9.33` |
| [thiserror](https://github.com/dtolnay/thiserror) | `1.0.57` |
`1.0.58` |
| [reqwest](https://github.com/seanmonstar/reqwest) | `0.11.25` |
`0.11.26` |

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-18 09:41:01 +00:00
Manichand Kondapaka
c633f85f57
Updated static and const (#1881)
Updated the content for space issue .
#1464 issue.
2024-03-15 09:01:41 -04:00
Nicole L
7cd25c0262
Move slices and strings to references section (#1898)
This PR moves the slides for slices and strings into the day 1 section
on references. This seems like the more natural place to introduce
slices since slices are a type of reference. It then also made sense to
me to follow that with the introduction of `&str` and `String`, since
students now have the context to understand what a "string slice" is. I
also removed the strings slide from the types and values section since
it didn't make sense to cover the same topic twice in the same day. I
tested this new organization in my class on Wednesday and it didn't
cause day 1 to take too long.
2024-03-14 16:21:15 -04:00
kochinc
4b27e28e7f
Update bounded.md (#1919)
Shouldn't it be `recv` instead of `read`? I don't see a `read` function
in Receiver.
2024-03-12 20:48:54 +00:00
Dustin J. Mitchell
ac2cb44d54
Cover Supertraits, Generic Traits (#1854) 2024-03-12 13:49:39 +00:00
Nicole L
d0656ca90b
Simplify generic min exercise (#1900)
I was a bit dissatisfied with the test code for the generic min
exercise. We were supposed to be testing that the student wrote the
generic function correctly, but we only test their `min` function with
one type. I rewrote the exercise to test against multiple types, which
required that we use the regular `Ord` trait rather than a custom one. I
tend to prefer using the real items from `std` when we can because it's
a good way to get students familiar with the standard library. I also
removed the custom `Citation` type since it wasn't really important to
the exercise.
2024-03-11 18:33:03 -04:00
Nicole L
025fbffa99
Remove generics from logger exercise (#1899)
The logger exercise comes before the section on generics, and the
purpose of the exercise is for students to get practice writing a trait
implementation, so using generics in the solution is a source of
confusion for students. I've removed the generic and made
`VerbosityFilter` directly hold a `StderrLogger`.
2024-03-11 16:30:38 -04:00
Damiano Ferrari
9059a1aa38
Update fibonacci exercise.rs (#1909) 2024-03-11 14:09:47 +00:00
dependabot[bot]
595ecbcaa7
cargo: bump the minor group with 1 update (#1914)
Bumps the minor group with 1 update:
[http](https://github.com/hyperium/http).

Updates `http` from 1.0.0 to 1.1.0

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-11 10:50:44 +00:00
dependabot[bot]
e6b62f465c
cargo: bump the patch group in /src/exercises/bare-metal/rtc with 2 updates (#1913)
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-03-11 10:50:28 +00:00
dependabot[bot]
eb3dd875fb
cargo: bump the patch group in /src/bare-metal/aps/examples with 1 update (#1916)
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.88 to 1.0.90

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-11 10:28:39 +00:00
dependabot[bot]
a265ca3222
cargo: bump the patch group with 4 updates (#1915)
Bumps the patch group with 4 updates:
[clap](https://github.com/clap-rs/clap),
[reqwest](https://github.com/seanmonstar/reqwest),
[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-03-11 10:28:24 +00:00
dependabot[bot]
dc597531fd
cargo: bump the patch group in /src/bare-metal/microcontrollers/examples with 1 update (#1912)
Bumps the patch 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.0 to 0.16.1

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-11 10:27:03 +00:00
Aaron M
3ac3b301bc
Fix typo in associated-types.md (#1887)
A minor nitpick, but as someone new to the language I did spend a bit
more time than I'd like to admit trying to understand the meaning of
`allow` before realizing this is likely a typo. Maybe I still don't
understand, and in that case I'd appreciate a correction!
2024-03-07 13:56:30 +00:00
Frances Wingerter
e362b44b66
concurrency: Update async trait slide (#1883)
Clarify that the basics are stable, but dyn support is still missing.
This slide was outdated and didn't explain the current state of stable
correctly.
2024-03-06 16:37:48 -05:00
Frances Wingerter
42f6e1186e
Do not show trait vtables as located in the heap in memory diagram (#1882)
This diagram is misleading and I often explain that the character data
of string literals resides in the executable's static data, with vtables
working the same.
2024-03-06 16:22:16 -05:00
Frances Wingerter
976f6f6f24
concurrency: Add detailed teaching notes for welcome and threads slides (#1885)
These follow the flow of what I actually teach, which spends a
significant amount of time on the latter slide. I think it's worthwhile
to have a real flow documented in the teaching notes, both to make sure
nothing gets forgotten and to structure the experience of teaching.
2024-03-06 21:11:52 +00:00
Frances Wingerter
429694fa63
Tweak solution to iter exercise (#1884)
Because `.zip()` is limited to the shorter length, the `.take()` call
here is unnecessary. When explaining this solution I don't want to have
to explain a call to a method that, used as it is, does nothing.
2024-03-06 20:18:31 +00:00
Yuri Astrakhan
9404a22b15
Make diagram consistent with code (#1855) 2024-03-06 17:12:09 +01:00
Manichand Kondapaka
f00981c663
Divided Array and tuples (#1859)
#1824 PR Changes
2024-03-06 09:24:01 -05:00
geekvest
13cf920e08
Fix some typos (#1864)
Signed-off-by: geekvest <cuimoman@sohu.com>
2024-03-05 16:28:55 -05:00
Martin Geisler
1b3984df20
Move Mockall and GoogleTest slides to Android section (#1533)
After #1528 and #1532, we now have actual slides which showcase the
crates in action. So we can reclaim a few minutes by removing the slide
which mentions Mockall and GoogleTest slide.

The slide mentioned [proptest](https://docs.rs/proptest) and
[rstest](https://docs.rs/rstest) as well. While I'm sure the libraries
are useful, we don't have them imported into AOSP and I've never
personally used them. We should therefore not advertise them yet at this
point since they won't be useful to Android engineers.

Of course we can mention things that are not in AOSP (or in Chromium),
but I think we should do it in the speaker notes at most.
2024-03-04 16:25:35 +01:00
Gergely Risko
c763932288
Small formatting fix (#1866)
This is a typo, that actually @mgeisler stopped in my previous PR, I was
just not around to fix it fast enough to make it to the previous merge.
Thanks for the catch!
2024-03-04 09:46:59 -05:00
dependabot[bot]
9a72b87fa9
cargo: bump the minor group with 2 updates (#1870)
Bumps the minor group with 2 updates:
[scraper](https://github.com/causal-agent/scraper) 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>
2024-03-04 11:37:43 +00:00
dependabot[bot]
e2c38d106e
cargo: bump the patch group in /src/exercises/bare-metal/rtc with 1 update (#1874)
Bumps the patch group in /src/exercises/bare-metal/rtc with 1 update:
[log](https://github.com/rust-lang/log).

Updates `log` from 0.4.20 to 0.4.21

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-04 11:00:43 +00:00
dependabot[bot]
1e6fa1cb49
cargo: bump the patch group with 4 updates (#1873)
Bumps the patch group with 4 updates:
[log](https://github.com/rust-lang/log),
[tempfile](https://github.com/Stebalien/tempfile),
[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-03-04 10:55:27 +00:00
dependabot[bot]
64e3a88d80
cargo: bump the patch group in /src/bare-metal/aps/examples with 1 update (#1871)
Bumps the patch group in /src/bare-metal/aps/examples with 1 update:
[log](https://github.com/rust-lang/log).

Updates `log` from 0.4.20 to 0.4.21

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-04 10:54:04 +00:00
Nicole L
c1e605df25
Rework introduction of pattern matching (#1843) 2024-02-28 11:14:53 -08:00
Martin Geisler
dc4a1eb53b
Skip translation of large bare-metal code blocks (#1853)
This was done a bit inconsistently before. We now skip all of these
large blocks which are meant to be used as-is by the students.

This removes 700 lines from the PO files. I found this during the review
of #1651.
2024-02-27 16:53:05 +01:00
Max Heller
3e7ce5e6ee
Link to PDF version of course from first page (#1836)
Re
https://github.com/google/comprehensive-rust/pull/1805#pullrequestreview-1888804528

---------

Co-authored-by: Martin Geisler <martin@geisler.net>
2024-02-26 13:24:28 +01:00
dependabot[bot]
afe9814ef0
cargo: bump the patch group in /src/exercises/bare-metal/rtc with 1 update (#1852)
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.83 to 1.0.88

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-26 10:51:48 +00:00
dependabot[bot]
a5d86d36df
cargo: bump the patch group in /src/bare-metal/aps/examples with 1 update (#1851)
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.83 to 1.0.88

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-26 10:51:06 +00:00
Adrian Taylor
3afdabf391
Update cargo.md to fix typos (#1848) 2024-02-23 11:18:04 -08:00
Nicole L
5ecdddf9c8
Remove tangential text from if slide (#1840) 2024-02-23 08:53:26 -08:00
Martin Geisler
099ca497f2
Fix typo in cargo.md (#1847) 2024-02-23 14:15:58 +00:00
Henri F
847e1a038e
Fix definition of Rust Fundamentals in glossary.md (#1844)
Small nitpick: Days 1 to **4** are Rust Fundamentals
2024-02-23 10:06:44 +01:00
Nicole L
d75dd5d681
Flesh out for loop example (#1841)
* Add example of iterating over a collection.
* Update speaker notes to call out the use of iterators.

I think it's useful to call out that `for` loops primarily are used to
iterate over a collection of objects, even though we haven't yet talked
about any concrete collection types at this point. I think using the
array literal syntax is simple enough to understand that it should be
quick to explain when we get to this slide.
2024-02-22 10:49:49 -05:00
Nicole L
9023dd9caa
Tweak timings of exercises to better reflect teaching times (#1839)
A few of the early exercises had much larger estimates than were
actually necessary for the super simple early exercises. I've gone
through and reviewed the time estimates for exercises and tweaked the
estimates based on how much time students have actually needed in my
classes so far.
2024-02-22 10:21:39 -05:00
Martin Geisler
8670d2f9d9
Add translation comment to glossary (#1831)
With https://github.com/google/mdbook-i18n-helpers/pull/107 merged, we
can begin adding comments for the translators to our Markdown files.
2024-02-22 15:10:01 +01:00
Nicole L
e7076af00f
Move hello world example to second section (#1838)
The current location for the hello world example is awkward since the
two surrounding pages are both talking about Rust from a high level
without talking about syntax at all. I think starting the second section
(types and values) with the hello world example would help the first
section flow more smoothly.
2024-02-21 16:54:11 -05:00
Michael Graf
7fb4ad9ed2
Update user-defined-types/exercise.md (#1835)
Allow us to edit so we can complete the exercise :)
2024-02-20 22:08:39 +00:00
Jean Carlo Vicelli
c6ef83e512
Update exercise to add also the tests, in a TDD style (#1832)
Having the tests only in the result brings less value, so the
participants can do it following TDD practices
2024-02-20 17:04:53 -05:00
Dustin J. Mitchell
95fce416ce
Expand Traits, add associated types (#1815)
This breaks the "Traits" slide into three smaller sub-slides. It also
addresses part of #1511 by explicitly addressing associated types.

---------

Co-authored-by: Martin Geisler <martin@geisler.net>
2024-02-20 11:41:53 -05:00
Jean Carlo Vicelli
9d63f23f1d
Change hardcoded vector update to a for loop (#1833)
iterating over the vector instead of hardcoding each item

---------

Co-authored-by: Martin Geisler <mgeisler@google.com>
2024-02-20 17:29:49 +01:00
titong0
8344cbc273
Add missing editable attribute to exercise (#1827)
I was reading the docs and I stumbled upon this.

I'm unsure about when exercises should be solved directly on the site
and when they should be copied and pasted into a playground. But since
the previous chapter's exercise is solvable in the site [(fibonacci
sequence)](0cb7f496b5/src/types-and-values/exercise.md (L15)),

I figured this one might be missing the attribute. Anyway amazing work
on the docs!
2024-02-20 16:12:55 +00:00
Gergely Risko
d5879d87b2
Reformulate speaker notes regarding Box (#1819)
The first change is to reformulate the English in a way, that
emphasizes, that this is not a decision of the compiler, but the
impossibility of computing an infinite value (e.g. changed the language
from "not compute" to "would not be able to compute").

The second change is to fix the error message, of course the error
message from the compiler is "recursive withOUT indirection", as
"recursive with indirection" is actually what we want.
2024-02-20 09:16:25 -05:00
Henri F
85d2987369
Update translations.md with new Korean contributor (#1823)
Co-authored-by: Martin Geisler <mgeisler@google.com>
2024-02-20 10:50:42 +00:00
Marja Hölttä
f1e4f300ec
Make the "break with label" example more illustrative (#1830)
In the old version, using "break 'outer;" and using "break;" (without
the label) produce the same output.

This version fixes that to make the example more illustrative.

---------

Co-authored-by: Martin Geisler <martin@geisler.net>
2024-02-20 10:06:29 +00:00
mobyw
6b805230c7
Add heading attribute to glossary.md (#1829)
Add heading attributes[1] to avoid ID changes in translation.

[1]: https://rust-lang.github.io/mdBook/format/markdown.html#heading-attributes

Related: #1825

---------

Co-authored-by: Martin Geisler <martin@geisler.net>
2024-02-20 10:00:59 +00:00