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.
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 1 update:
[googletest](https://github.com/google/googletest-rust).
Updates `googletest` from 0.10.0 to 0.11.0
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [mockall](https://github.com/asomers/mockall) from 0.12.0 to
0.12.1.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/asomers/mockall/blob/master/CHANGELOG.md">mockall's
changelog</a>.</em></p>
<blockquote>
<h2>[ 0.12.1 ] - 2023-12-21</h2>
<h3>Fixed</h3>
<ul>
<li>
<p>Fixed using <code>#[mockall::concretize]</code> on functions whose
generic types contain
trait bounds, yet are still object safe.
(<a
href="https://redirect.github.com/asomers/mockall/pull/531">#531</a>)</p>
</li>
<li>
<p>Fixed mocking methods that use raw identifiers for their names. This
was a
regression in 0.12.0.
(<a
href="https://redirect.github.com/asomers/mockall/pull/534">#534</a>)</p>
</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="51c4820bc6"><code>51c4820</code></a>
chore: Release</li>
<li><a
href="20e1c6d12b"><code>20e1c6d</code></a>
chore: Release</li>
<li><a
href="940690202f"><code>9406902</code></a>
Merge pull request <a
href="https://redirect.github.com/asomers/mockall/issues/534">#534</a>
from asomers/raw_identifier</li>
<li><a
href="b252265824"><code>b252265</code></a>
Merge pull request <a
href="https://redirect.github.com/asomers/mockall/issues/538">#538</a>
from asomers/mit-or-apache</li>
<li><a
href="80fee05bd5"><code>80fee05</code></a>
[skip ci] Clarify license terms</li>
<li><a
href="71823a3acc"><code>71823a3</code></a>
Fix mocking functions that use raw identifiers for their names.</li>
<li><a
href="d4e07102b7"><code>d4e0710</code></a>
Merge pull request <a
href="https://redirect.github.com/asomers/mockall/issues/531">#531</a>
from asomers/concretize-bounds</li>
<li><a
href="b1f0e78057"><code>b1f0e78</code></a>
Fix using #[concretize] on functions with bounded generic types</li>
<li><a
href="7e4af040db"><code>7e4af04</code></a>
chore: Release</li>
<li><a
href="d605f45ecc"><code>d605f45</code></a>
[skip ci] update version number in mockall_double/README.md</li>
<li>See full diff in <a
href="https://github.com/asomers/mockall/compare/v0.12.0...v0.12.1">compare
view</a></li>
</ul>
</details>
<br />
[](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
</details>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This is the result of running `dprint fmt` after removing `src/` from
the list of excluded directories.
This also reformats the Rust code: we might want to tweak this a bit in
the future since some of the changes removes the hand-formatting. Of
course, this formatting can be seen as a mis-feature, so maybe this is
good overall.
Thanks to mdbook-i18n-helpers 0.2, the POT file is nearly unchanged
after this, meaning that all existing translations remain valid! A few
messages were changed because of stray whitespace characters:
msgid ""
"Slices always borrow from another object. In this example, `a` has to remain "
-"'alive' (in scope) for at least as long as our slice. "
+"'alive' (in scope) for at least as long as our slice."
msgstr ""
The formatting is enforced in CI and we will have to see how annoying
this is in practice for the many contributors. If it becomes annoying,
we should look into fixing dprint/check#11 so that `dprint` can annotate
the lines that need fixing directly, then I think we can consider more
strict formatting checks.
I added more customization to `rustfmt.toml`. This is to better emulate
the dense style used in the course:
- `max_width = 85` allows lines to take up the full width available in
our code blocks (when taking margins and the line numbers into account).
- `wrap_comments = true` ensures that we don't show very long comments
in the code examples. I edited some comments to shorten them and avoid
unnecessary line breaks — please trim other unnecessarily long comments
when you see them! Remember we're writing code for slides 😄
- `use_small_heuristics = "Max"` allows for things like struct literals
and if-statements to take up the full line width configured above.
The formatting settings apply to all our Rust code right now — I think
we could improve this with https://github.com/dprint/dprint/issues/711
which lets us add per-directory `dprint` configuration files. However,
the `inherit: true` setting is not yet implemented (as far as I can
tell), so a nested configuration file will have to copy most or all of
the top-level file.
I swear I tested this in an actual Rust file, but I somehow messed up
when copy-pasting it into the example. The code is now in the test file
so it will be correct.
Why is the indentation wrong? Because of
https://github.com/rust-lang/mdBook/issues/1564
The indentation is not kept by the included content, which breaks the
Markdown.
As more and more Android teams start using Rust, the question of "How to do mocking?" has come up more frequently. Right now, we don't have a good answer to those teams, AOSP doesn't have any mocking framework available. That will change soon with the import of Mockall and this slide is part of the supporting documentation that we can point teams to.
I've taken some work by @fw-immunant and others on the new organization
of the course and condensed it into a form amenable to a text editor and
some computational analysis. You can see the inputs in `course.py` but
the interesting bits are the output: `outline.md` and `slides.md`.
The idea is to break the course into more, smaller segments with
exercises at the ends and breaks in between. So `outline.md` lists the
segments, their duration, and sums those durations up per-day. It shows
we're about an hour too long right now! There are more details of the
segments in `slides.md`, or you can see mostly the same stuff in
`course.py`.
This now contains all of the content from the v1 course, ensuring both
that we've covered everything and that we'll have somewhere to redirect
every page.
Fixes#1082.
Fixes#1465.
---------
Co-authored-by: Nicole LeGare <dlegare.1001@gmail.com>
Co-authored-by: Martin Geisler <mgeisler@google.com>
We should default to making code blocks editable: this ensures
consistent syntax highlighting (see #343) and it allows the instructor
to freely edit anything they want.