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>
Bumps the patch group in /src/bare-metal/aps/examples 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>
The current example demonstrating how rustc prevents dangling references
is really gross and hard to read (my own fault lol, I wrote that
example). I finally realized that there's a much simpler, easier to read
way of expressing the same thing. I also moved this to its own slide
after the reference slides so that we can call it out as an early
example of the borrow checker. I then call back to this example in the
borrow checker slide to remind students that the aliasing rule isn't the
only thing the borrow checker is enforcing.
The side bar is out of date, and also the the unit testing docs are
talking about integration tests. These tests are discussed on the next
slide in "Other Types of Tests".
I think it would be good to simplify the expression evaluation exercise
by removing the error handling around the divide-by-zero case. I think
it overcomplicates the exercise and and adds confusion since at this
point we haven't introduced `Result` (or at least not in any detail).
This allows the students to just focus on writing the pattern matches on
`Expression` and `Op`, and allows the exercise to be shorter (and I
think we need to free up some time where we can, my classes often run
long and cut into how much time students have for exercises).
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.
"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>
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.
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>
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.