The current slide on visibility introduces the idea that modules are the
encapsulation boundary, but it doesn't explicitly doesn't talk about
struct fields/methods. I think it's worth talking explicitly about
structs and encapsulation because most students are going to be coming
from a background where types (instead of modules) are the encapsulation
boundary. It's worth talking explicitly about how encapsulation works,
even if we're kind of repeating information from the previous slide.
The `(&values).into_iter()` construct used in the solution to the
iterators exercise is kind of awkward and always gets questions from
students. I think the better thing would be to use the `iter` method to
get the initial iterator, as that's the more idiomatic way to. It's also
an opportunity to point out that there are helper methods for getting an
iterator for a collection.
The solution to the modules exercise changes how `Button`, `Window`, and
`Label` are referenced, adding a `widgets::` prefix to them. This seems
weird to me because the more idiomatic thing to do would be to import
those types at the top of the file. Unless I'm missing a reason why the
solutions is written the way it is, I think this is a good
simplification.
It used to have a ugly error message shows that "Playground
Communication: Cannot read properties of undefined (reading 'trim')",
which is due to the fact that the response lacks stdout attr.
Issue: #2477
Signed-off-by: Alx-Lai <alexabc722@gmail.com>
"Third-party" is a Googleism that doesn't make much sense otherwise.
Most references to crates just say "crate", implying that they are
open-source packages available on https://crates.io, so this updates a
few additional locations to do the same.
On my chromebook:
* I needed build-essentials to install cc
* I needed to enable sharing the USB device with linux. This instruction
was from a support.google.com article so well-known but not obvious.
---------
Co-authored-by: Martin Geisler <martin@geisler.net>
Update translations from SUMMARY.md.
Unfortunately, poedit changes the wrapping length of the po files and I
could not get it back by changing the poedit setting for line length. I
believe we won't get any more of these noisy diffs for my further
changes this week.
`Cancellation` is the last item I modified in this PR.
---------
Co-authored-by: Hidenori Kobayashi <hidenorik@google.com>
Without this, compilation fails. The comment *is* in the included Rust
file — but we only include a fraction of the file to keep the example
short. This makes it cumbersome to both show something that works in the
slides while also making it possible for the instructor to show more
complex examples.
@randomPoison, we need to make our examples simpler here: the complexity
here makes it hard to modify the files and I feel it's hard to show
during class. I would suggest splitting this up into a very basic
example (what the birthday service was) and then add 1-2 slides with
more complex samples (if necessary). Last I taught the class, I had a
hard time a) making every example compile and b) finding time to cover
everything.
I would err on the side of makings things simple and clear.
The page is not mentioned in the `SUMMARY.md` file and has apparently
been forgotten.
We could consider adding a check for this situation, but since I don't
think it occurs very often, I don't consider it high priority.
This is a first draft for a test framework for testing the JS part of
the book that is discussed in #2462
It is using [webdriverIO](https://webdriver.io/) and the webdriverIO
[Expect API](https://webdriver.io/docs/api/expect-webdriverio/) in
combination with [Mocha](https://mochajs.org/). WebdriverIO is taking
care of accessing the webpage with a real browser and can access the
state of the page so behavior can be asserted.
Currently only a small test for the speaker-notes implementation demos
the functionality.
The [Static Server
Service](https://webdriver.io/docs/static-server-service/) is used to
serve the book in a way that the test runner can access it.
A CI integration can look like https://webdriver.io/docs/githubactions/
and is implemented with a headless setup. In CI it uses the language
variable to set environment variable that configures where the built
book should be mounted from
---------
Co-authored-by: Martin Geisler <martin@geisler.net>
I don't know how controversial this is, but I would recommend against
using type aliases where a newtype can be used instead.
Personally, I don't like type aliases much since I feel they cause extra
indirection: I will inevitably have to go look up the alias the first
many times I encounter it. Nothing will tell me to apply the type alias
consistently, and I dislike having multiple names for the same thing.
But I'm sure some people love them, so now I'm just gently reminding
people that newtypes can be a better alternative.
Bumps the patch group in /src/exercises/bare-metal/rtc with 1 update:
[arm-gic](https://github.com/google/arm-gic).
Updates `arm-gic` from 0.1.1 to 0.1.2
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps the minor group in /src/exercises/bare-metal/rtc with 1 update:
[cc](https://github.com/rust-lang/cc-rs).
Updates `cc` from 1.1.31 to 1.2.2
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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.4 to 0.7.5
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps the patch group in /src/bare-metal/microcontrollers/examples with
1 update: [cortex-m-rt](https://github.com/rust-embedded/cortex-m).
Updates `cortex-m-rt` from 0.7.3 to 0.7.5
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps the minor group in /src/bare-metal/aps/examples with 1 update:
[cc](https://github.com/rust-lang/cc-rs).
Updates `cc` from 1.1.31 to 1.2.2
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Reverts google/comprehensive-rust#2397
I'm seeing
```
POST https://play.rust-lang.org/execute 500 (Internal Server Error)
```
on every request when trying to run code in the Playground. I'm not sure
why, but we need to revert this ASAP if others see the same.
Add a stderr block.
Pros:
- we can make use of dbg macro in our code Cons:
- there's a limitation that the compile message also shows
Applies patches from rust-lang/mdBook#1315 since the original change was
not merged by rust-lang.
Issue: #531
Signed-off-by: Alx-Lai <alexabc722@gmail.com>
Let me refresh the po file, since I plan to work on some of the fuzzy
translation stuff this week.
This is basically output of only doing: `msgmerge --update po/ja.po
book/xgettext/messages.pot` and removing a few fuzzy tags for obviously
correct translations.
Co-authored-by: Hidenori Kobayashi <hidenorik@google.com>
Some lines were much longer than others. They are now consistently
wrapped at 70 columns. Why so short, why not 80 or 90? Because we
sometimes need to browse these files during class, and there we don’t
have a lot of horizontal space when using large fonts.
Naming the slide “Bare-Metal Android” avoids an annoying situation
when searching: before, searching for “android” would list this slide
as a top hit because it matches the search term precisely. This meant
that the whole Rust in Android section course was harder to find.
With this change, the “Welcome to Rust in Android” page becomes easier
to find.
to catch wrong `right == 0` checks.
To change the number like this catches for example a wrong
implementation only looking if `right_result` is zero, but not checking
if we are doing a division.
Bumps the patch group in /src/exercises/bare-metal/rtc with 1 update:
[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>