This is the result of running `cargo update` in every directory.
It fixes a alert: https://github.com/advisories/GHSA-9mcr-873m-xcxp. We
don’t run any HTTP server directly, so this is not super important for
us. However, it will remove the alert from my dashboard.
This builds on the work of @dyoo in
https://github.com/google/mdbook-i18n-helpers/pull/69: by adding a
special `<!-- mdbook-xgettext: skip -->` comment, we can skip the
following code block.
I also modified a few code blocks to remove translatable text: variable
names are not expected to be translated, so it’s fine to have a line
with `println!("foo: {foo}")` in the code block.
This PR removes 36 messages from the POT file. The number of lines drop
by 633 (3%).
Part of #1257.
Reverts google/comprehensive-rust#225. We normally include links at the
start of each exercise blocks — but we don't include links in the
individual exercises.
If we want to add such links, we should do it consistently across the
entire course.
As pointed out by @njr0 in #1233, we were making the exercise confusing
by showing people code that cannot work — and then expecting the course
participants to somehow fix this, without setting clear boundaries for
what can and cannot be modified.
This PR should align the exercise with the other exercises in the course
and avoid the “brain teaser” here.
This also has the advantage of having a full working solution, with no
commented code which will bit-rot over time.
Adding speaker notes about more details when people might want to call
`drop`.
It is not about a `Drop` trait per-se, but if this is to be mentioned in
the course, this is a reasonable place.
---------
Co-authored-by: Martin Geisler <mgeisler@google.com>
Co-authored-by: Martin Geisler <martin@geisler.net>
This streamlines the text about editors by simply mentioning them.
RustRover is mentioned last since it's new and I don't have any
experience with it yet.
The licenses end up in the PO files, causing extra unnecessary for work
our translators. We save about 300 lines from each PO file with this.
This also solves another small problem: when a file is included with an
anchor, other anchors are automatically stripped away. This removes some
confusing `// ANCHOR: foo` and `// ANCHOR_END: foo` lines in the
solutions.
Since JetBrains [announced RustRover as their new Rust IDE
(preview)](https://www.jetbrains.com/rust/), I updated the details with
a suggestion for RR in `Using Cargo`.
In the exercise guideline for the Luhn's algorithm (Day 1, Afternoon
exercise), I made a correction to step 3 to provide a more accurate
explanation. Instead of stating that doubling 7 becomes 14, I clarified
that doubling 7 results in 14, and we should sum the individual digits
of 14 to get the correct value of 5.
Hello there 👋 I'm the author of the `tokio-websockets` crate and
today we published version `0.4.0` of the crate, which finally makes the
public API consistent and aligns it with expectations.
`WebsocketStream` now implements the `Stream` trait, so calling `next()`
has to be done via `StreamExt` now. `connect()` returns a tuple of
`(WebsocketStream, Response)`, so that has to be deconstructed now. And
finally, `as_text()` now returns an `Option<&str>` instead of
`Result<&str, Error>`.
And, *very* importantly: The old `WebsocketStream::next` was **not**
cancellation safe, the new `Stream` implementation is. The exercise uses
`select!`, which very well might have caused misbehavior.
Since we also emptied the default features, I've added the very minimal
ones required to compile the exercise.
This is my first contribution here, so feel free to point me to some
things if I'm missing anything. I wasn't really sure what to do about
the translations, I guess I should leave them as is and they'll be
updated by translators in other PRs?
Signed-off-by: Jens Reidel <adrian@travitia.xyz>
Adding this test case to handle case where we have non-numeric cc number
along with a valid cc number. This is discovered when we filter with
is_numeric() instead of !is_whitespace() all test case does pass. To
handle such scenario adding this test case.
Hi all!
This CL fixes#1093:
* Avoids including current false-positives in the checking of typos
* Excludes localization-related files, as `typos` works with
English words
* Fixes existing typos caught in the repo
Tested this in CI with a typo and it showed up in the list of actions!
---------
Co-authored-by: Martin Geisler <martin@geisler.net>
…llers/examples
The proc-macro2 dependency at 1.0.50 results in a build error mentioning
an unknown feature `proc_macro_span_shrink` that no longer exists in
nightly. Per https://github.com/rust-lang/rust/issues/113152, updating
proc-macro2 to the latest version fixes the error.
The build error I saw before updating the proc-macro2 dependency was the
following:
```
> cargo build --bin minimal
Compiling proc-macro2 v1.0.50
Compiling bare-metal v0.2.5
Compiling typenum v1.16.0
Compiling nrf52833-hal v0.14.1
error[E0635]: unknown feature `proc_macro_span_shrink`
--> /home/chcl/.cargo/registry/src/index.crates.io-6f17d22bba15001f/proc-macro2-1.0.50/src/lib.rs:92:30
|
92 | feature(proc_macro_span, proc_macro_span_shrink)
| ^^^^^^^^^^^^^^^^^^^^^^
Compiling cortex-m v0.7.7
For more information about this error, try `rustc --explain E0635`.
error: could not compile `proc-macro2` (lib) due to previous error
warning: build failed, waiting for other jobs to finish...
```
This is a follow-up to #998 and the discussion in #1049. The
comparison page is now gone: like @randomPoison said, it feels
redundant and I also mostly skip over it when teaching the class.
I also took out some duplication in the Rust memory management page. I
would be up for simplifying the whole chapter down to one or two
slides as @djmitche suggests: that would leave us with more time for
covering ownership.
Most classes run with 2.5 hours for the morning session and 2.5 hours
for the afternoon session.
I have tried running the course as 2 × 2.5 hours and 2 × 3 hours. My
experience was that people ended up getting really worn out after
spending 6 hours in total on Rust (7 hours including a lunch break).
However, the experience varies from group to group, so this is just a
recommendation.
I'm trying to align on these names for the additional material:
- Rust in Android
- Bare-Metal Rust
- Concurrency in Rust
It's not perfectly reflected everywhere, but this brings us a bit closer
to that.
- Morning of Day 1 still introduces the language and its high-level
goals/value proposition, and starts with the built-in data types Rust
provides, and how you define a function.
- Afternoon of Day 1 gets a front loading of the basic control flow
structures in Rust but not the more exotic ones.
- The exercises for day 1 afternoon will be the Luhn algorithm (where we
can match on digits and enums such as `Option`.
- Morning of day 2 still has discussion of memory management.
Fixes#510.
---------
Co-authored-by: Martin Geisler <mgeisler@google.com>
Drops the comment about usage in the other loop. It's not related to the
focus on copy semantics, and so we want to eliminate that possible
confusion.
---------
Co-authored-by: Martin Geisler <martin@geisler.net>
* help students with the luhn exercise
* mention method-specific types in speaker notes
* Update src/exercises/day-2/luhn.md
Co-authored-by: Martin Geisler <martin@geisler.net>
---------
Co-authored-by: Martin Geisler <martin@geisler.net>
While we don’t have slides showing how to use the crate (#823), we can
at least explain at a high level what the instructor should focus on
when walking through the tutorial.
When building the book, mdBook will always generate an `index.html`
page for first page of the book. This meant that we had the same
content available under two different names:
- `welcome.html`: this is what the TOC would link to, and
- `index.html` or simply `/`: this is what search engines link to
Renaming the page and setting up a redirect should fix this confusion.
We still don’t have a good way of avoiding links to the `index.html`
page, but this should fix the first half of the problem.
I tested this for translations as well by building the output in a
subdirectory and serving the parent directory.
Part of #847.
* Talk about options in `?` chapter
* Combine Option and Result examples
* Update try-operator.md
* Remove semicolon from expansion
* Focus on expansion of `expr?`
* Update try-operator.md
* Update try-operator.md
---------
Co-authored-by: Martin Geisler <mgeisler@google.com>
Conceptually, I'm now thinking of Day 1 to Day 3 as belonging to "Rust Fundamentals", which together with the deep dives make up what we call "Comprehensive Rust".
* Align dining-philosophers-async.rs with sync version
This updates the version to use `std::mem::swap` like the synchronous version.
* Apply suggestions from code review
* Remove statement that data is moved when assigning
The distinction between non-`Copy` and `Copy` types is tricky to explain. One problem is that people often focus on _moving_ vs _copying_ when both variable types always copy data.
This PR removes the statement about moving data (since that is wrong on its own).
* Apply suggestions from code review
Co-authored-by: Dustin J. Mitchell <djmitche@google.com>
* Apply suggestions from code review
Co-authored-by: Dustin J. Mitchell <djmitche@google.com>
---------
Co-authored-by: Dustin J. Mitchell <djmitche@google.com>
* Rust isn't functional, but it does have functional elements
* End sentence
Co-authored-by: Martin Geisler <martin@geisler.net>
* add info about OO
---------
Co-authored-by: Martin Geisler <martin@geisler.net>