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>
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!
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.
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>
Bumps the patch group with 1 update:
[clap](https://github.com/clap-rs/clap).
Updates `clap` from 4.5.0 to 4.5.1
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
I added a tranlation correction on the line 1287, I change "tres"
instead "cuatro", because "cuatro" is the meaningful of four in Spanish.
---------
Co-authored-by: Henri F <henrif75@users.noreply.github.com>
This is a clean refresh, requires only a syntaxtical review.
You can skim this PR with the [GitHub CLI](https://cli.github.com/):
```
gh pr diff 1751 | bat -l patch
```
This is a clean refresh, requires only a syntactical review.
You can skim this PR with the [GitHub CLI](https://cli.github.com/):
```
gh pr diff 1742 | bat -l patch
```
I added a tranlation correction on the line 1287, I change "tres"
instead "cuatro", because "cuatro" is the meaningful of four in Spanish.
---------
Co-authored-by: Henri F <henrif75@users.noreply.github.com>
Tested with rust 2015, 2018, 2021 and 2024, on amd64 musl, amd64 glibc
and aarch64 musl, all of them represent Strings with (ptr, capacity,
len).
This is an internal implementation detail, that shouldn't be exposed
anyway, so it's no big deal, but in the speaker notes, we provide a
debugging tool for demonstration purposes, so at least that should have
a correct output.
In the example, somebody who is trying to understand this code has to
follow a lot of moving pieces: prefix, name, make_greeter, and then also
learn the new move concept at the same time.
It'd be better if the content were to actually match the name of the
variables. "Hi" is a good prefix, but "there" is not a name, so let's go
with an actual name.
Bumps the patch group in /src/exercises/bare-metal/rtc with 1 update:
[chrono](https://github.com/chronotope/chrono).
Updates `chrono` from 0.4.33 to 0.4.34
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
In the details section, it is suggested to adjust the signature of the
nearest function to "lie" about the lifetimes returned to:
fn nearest<'a, 'q'>(points: &'a [Point], query: &'q Point) -> Option<&'q
Point> {
to demonstrate the compiler checks lifetimes for validity. However, the
syntax for 'q is incorrect and it should instead be
fn nearest<'a, 'q>(points: &'a [Point], query: &'q Point) -> Option<&'q
Point> {
Based on feedback from @marshallpierce that mornings took about 2.5
hours, this adjusts a bunch of the morning times downward to try to
match that. In other words, this is trying to make the times in the
course more accurate, rather than reducing the amount of time available
for these slides.
This also updates the `course-schedule` tool to be able to show
per-segment timings.
Bumps the minor group with 2 updates:
[pulldown-cmark](https://github.com/raphlinus/pulldown-cmark) and
[tokio](https://github.com/tokio-rs/tokio).
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>
Knowing to_string method is good for learner to use at some situation.
Knowing print complete struct object can be useful while debug.
---------
Co-authored-by: Dustin J. Mitchell <djmitche@google.com>
Swapping forks for one philosopher feels like cheating. It's like one of
the philosophers is facing away from the table. Or perhaps it's the only
right-handed philosopher at the table.
More importantly, there is no effective mechanism to prevent deadlocks.
Add that mechanism, it's useful for learning Rust.
The new code demonstrates let-else, drop and returning values from a
loop. `std::mem::swap` remains in the thread version of the Dining
Philosophers exercise for now.
This also fixes compilation. `left_fork` and `right_fork` had to be
`mut` in `main()` for the workaround to compile.