1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2024-12-01 10:51:06 +02:00
Commit Graph

31 Commits

Author SHA1 Message Date
Martin Geisler
d0bab8302c
Add slide to show the Mockall crate in action (#1532)
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.
2023-12-01 09:36:06 -05:00
Martin Geisler
8862ab6530
Add slide on GoogleTest (#1528)
We expect Android engineers to start using this crate going forward.
2023-11-30 14:57:00 +01:00
Dustin J. Mitchell
6d19292f16
Comprehensive Rust v2 (#1073)
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>
2023-11-29 16:39:24 +01:00
dependabot[bot]
0324fc44c8
build(deps): bump openssl from 0.10.59 to 0.10.60 (#1503)
Bumps [openssl](https://github.com/sfackler/rust-openssl) from 0.10.59
to 0.10.60.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/sfackler/rust-openssl/releases">openssl's
releases</a>.</em></p>
<blockquote>
<h2>openssl-v0.10.60</h2>
<h2>What's Changed</h2>
<ul>
<li>Correct off-by-one in minimum output buffer size computation by <a
href="https://github.com/alex"><code>@​alex</code></a> in <a
href="https://redirect.github.com/sfackler/rust-openssl/pull/2088">sfackler/rust-openssl#2088</a></li>
<li>Expose a few more (bad) ciphers in cipher::Cipher by <a
href="https://github.com/alex"><code>@​alex</code></a> in <a
href="https://redirect.github.com/sfackler/rust-openssl/pull/2084">sfackler/rust-openssl#2084</a></li>
<li>add temp key bindings by <a
href="https://github.com/jmayclin"><code>@​jmayclin</code></a> in <a
href="https://redirect.github.com/sfackler/rust-openssl/pull/2076">sfackler/rust-openssl#2076</a></li>
<li>Expose ChaCha20 on LibreSSL by <a
href="https://github.com/alex"><code>@​alex</code></a> in <a
href="https://redirect.github.com/sfackler/rust-openssl/pull/2093">sfackler/rust-openssl#2093</a></li>
<li>Revert &quot;Correct off-by-one in minimum output buffer size
computation&quot; by <a
href="https://github.com/alex"><code>@​alex</code></a> in <a
href="https://redirect.github.com/sfackler/rust-openssl/pull/2090">sfackler/rust-openssl#2090</a></li>
<li>Added <code>update_unchecked</code> to <code>symm::Crypter</code> by
<a href="https://github.com/alex"><code>@​alex</code></a> in <a
href="https://redirect.github.com/sfackler/rust-openssl/pull/2100">sfackler/rust-openssl#2100</a></li>
<li>fixes <a
href="https://redirect.github.com/sfackler/rust-openssl/issues/2096">#2096</a>
-- deprecate <code>X509StoreRef::objects</code>, it is unsound by <a
href="https://github.com/alex"><code>@​alex</code></a> in <a
href="https://redirect.github.com/sfackler/rust-openssl/pull/2099">sfackler/rust-openssl#2099</a></li>
<li>Don't leak when overwriting ex data by <a
href="https://github.com/sfackler"><code>@​sfackler</code></a> in <a
href="https://redirect.github.com/sfackler/rust-openssl/pull/2102">sfackler/rust-openssl#2102</a></li>
<li>Release openssl v0.10.60 and openssl-sys v0.9.96 by <a
href="https://github.com/alex"><code>@​alex</code></a> in <a
href="https://redirect.github.com/sfackler/rust-openssl/pull/2104">sfackler/rust-openssl#2104</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.59...openssl-v0.10.60">https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.59...openssl-v0.10.60</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="8f4b97ae06"><code>8f4b97a</code></a>
Merge pull request <a
href="https://redirect.github.com/sfackler/rust-openssl/issues/2104">#2104</a>
from alex/bump-for-release</li>
<li><a
href="df66283bbc"><code>df66283</code></a>
Release openssl v0.10.60 and openssl-sys v0.9.96</li>
<li><a
href="1a09dc8c94"><code>1a09dc8</code></a>
Merge pull request <a
href="https://redirect.github.com/sfackler/rust-openssl/issues/2102">#2102</a>
from sfackler/ex-leak</li>
<li><a
href="b0a1da5ee9"><code>b0a1da5</code></a>
Merge branch 'master' into ex-leak</li>
<li><a
href="f456b60936"><code>f456b60</code></a>
Merge pull request <a
href="https://redirect.github.com/sfackler/rust-openssl/issues/2099">#2099</a>
from alex/deprecate-store-ref-objects</li>
<li><a
href="a8413b8b54"><code>a8413b8</code></a>
Merge pull request <a
href="https://redirect.github.com/sfackler/rust-openssl/issues/2100">#2100</a>
from alex/symm-update-unchecked</li>
<li><a
href="a92c237941"><code>a92c237</code></a>
clippy</li>
<li><a
href="e839496d9e"><code>e839496</code></a>
Don't leak when overwriting ex data</li>
<li><a
href="602d38dca7"><code>602d38d</code></a>
Added <code>update_unchecked</code> to <code>symm::Crypter</code></li>
<li><a
href="cf9681a55c"><code>cf9681a</code></a>
fixes <a
href="https://redirect.github.com/sfackler/rust-openssl/issues/2096">#2096</a>
-- deprecate <code>X509StoreRef::objects</code>, it is unsound</li>
<li>Additional commits viewable in <a
href="https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.59...openssl-v0.10.60">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=openssl&package-manager=cargo&previous-version=0.10.59&new-version=0.10.60)](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)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/google/comprehensive-rust/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-29 10:01:30 +01:00
Martin Geisler
8b863c0446
Update Rust dependencies (#1487)
This fixes a low-criticality vulnerability in `atty` (on Windows):

  https://github.com/advisories/GHSA-g98v-hv3f-hcfr

I only updated the dependencies here which didn’t require code changes.
2023-11-20 09:26:19 -05:00
Nicole L
ca61ca4f57
Add CXX tutorial (#1392)
Add a number of slides that cover most of CXX's functionality and
demonstrate how it can be used.

Fixes #823.

---------

Co-authored-by: Martin Geisler <mgeisler@google.com>
2023-11-06 16:34:29 -08:00
dependabot[bot]
dd4460af06
Bump rustix from 0.38.15 to 0.38.19 (#1384)
Bumps [rustix](https://github.com/bytecodealliance/rustix) from 0.38.15
to 0.38.19.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="3a53dfe16c"><code>3a53dfe</code></a>
chore: Release rustix version 0.38.19</li>
<li><a
href="55cbe8839c"><code>55cbe88</code></a>
Fixes for <code>Dir</code> on macOS, FreeBSD, and WASI.</li>
<li><a
href="31fd98ca72"><code>31fd98c</code></a>
Merge pull request from GHSA-c827-hfw6-qwvm</li>
<li><a
href="4bb2f4bbcd"><code>4bb2f4b</code></a>
Add <code>mlockall</code> and <code>munlockall</code> (<a
href="https://redirect.github.com/bytecodealliance/rustix/issues/872">#872</a>)</li>
<li><a
href="d012bcf896"><code>d012bcf</code></a>
Fixes needed by io_uring. (<a
href="https://redirect.github.com/bytecodealliance/rustix/issues/873">#873</a>)</li>
<li><a
href="5e5c0460cc"><code>5e5c046</code></a>
Add a test for <code>get_socket_nosigpipe</code>. (<a
href="https://redirect.github.com/bytecodealliance/rustix/issues/874">#874</a>)</li>
<li><a
href="1a9d12963d"><code>1a9d129</code></a>
chore: Release rustix version 0.38.18</li>
<li><a
href="112c268cd7"><code>112c268</code></a>
io-uring API updates. (<a
href="https://redirect.github.com/bytecodealliance/rustix/issues/871">#871</a>)</li>
<li><a
href="0c227041a7"><code>0c22704</code></a>
Provide {get,set}_socket_nosigpipe on NetBSD and DragonFly BSD (<a
href="https://redirect.github.com/bytecodealliance/rustix/issues/870">#870</a>)</li>
<li><a
href="a00dbd0f53"><code>a00dbd0</code></a>
chore: Release rustix version 0.38.17</li>
<li>Additional commits viewable in <a
href="https://github.com/bytecodealliance/rustix/compare/v0.38.15...v0.38.19">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=rustix&package-manager=cargo&previous-version=0.38.15&new-version=0.38.19)](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)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/google/comprehensive-rust/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-18 16:49:15 -04:00
Martin Geisler
9f079f173b
Update all Cargo.lock files (#1295)
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.
2023-10-03 14:18:44 +02:00
Dustin J. Mitchell
4815264e2d
Add mdbook-course to handle parsing frontmatter (#1224)
In v2 of the course, I'd like to include an estimate of the time to be
spent on each segment in the Markdown file. I think a good place for
such metadata is in the frontmatter.

For review purposes, though, I just want to display that information.
So, this is a start at a new mdbook preprocessor that just separates out
the frontmatter and includes it in a `<pre>` block. Eventually, I'd like
to parse it and put the time in the speaker notes.

---------

Co-authored-by: Martin Geisler <martin@geisler.net>
2023-09-20 10:01:53 -04:00
Jens Reidel
fb95f779d2
Update dependencies in chat-app exercise (#1195)
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>
2023-09-11 10:19:13 -04:00
dependabot[bot]
f0d027b04a
build(deps): bump openssl from 0.10.49 to 0.10.55 (#849)
Bumps [openssl](https://github.com/sfackler/rust-openssl) from 0.10.49 to 0.10.55.
- [Release notes](https://github.com/sfackler/rust-openssl/releases)
- [Commits](https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.49...openssl-v0.10.55)

---
updated-dependencies:
- dependency-name: openssl
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-22 09:04:44 +02:00
rbehjati
83663daaa2
Add the description of the chat-app exercise (#641)
* Adds a description of the async chat exercise
* Simplifies the use of Error in chat-async
* Links the solution to the async chat exercise
* Removes the elevator exercise
2023-05-17 18:22:11 +01:00
Dustin J. Mitchell
caeabdae3e
Beginnings of an async chat exercise (#627)
* beginnings of an async chat exercise

* really basic solution

* format
2023-05-16 15:51:01 +00:00
Martin Geisler
3b07b4768a
Add unit tests to Safe FFI exercise (#588) 2023-05-04 12:20:47 +02:00
dependabot[bot]
d6e09c8130
Bump h2 from 0.3.16 to 0.3.17 (#565)
Bumps [h2](https://github.com/hyperium/h2) from 0.3.16 to 0.3.17.
- [Release notes](https://github.com/hyperium/h2/releases)
- [Changelog](https://github.com/hyperium/h2/blob/master/CHANGELOG.md)
- [Commits](https://github.com/hyperium/h2/compare/v0.3.16...v0.3.17)

---
updated-dependencies:
- dependency-name: h2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-14 10:33:30 +01:00
Andrew Walbran
edd9df042c Make exerciser an mdbook renderer. 2023-04-05 16:28:07 +01:00
Andrew Walbran
89c8eb0ef2 Add utility to build exercise starting directory from Markdown. 2023-04-05 16:28:07 +01:00
Martin Geisler
49bf110b31
Use mdbook-i18n-helpers crate (#552)
The i18n-helpers are now available as a stand-alone crate:
https://crates.io/crates/mdbook-i18n-helpers.

Because we cache the Rust binaries in our GitHub workflows, I bumped
the cache prefix to ensure we use a clean cache. Otherwise, Cargo
won’t install the new binaries in mdbook-i18n-helpers because it sees
the old ones from this repository.
2023-04-05 16:08:11 +02:00
Martin Geisler
41b29e210e
Update polib dependency to version 0.2.0 (#548)
The API changed a little from version 0.1.0.

The new release includes https://github.com/BrettDong/polib/pull/1,
which means we can simplify the code that writes a new PO file.
2023-04-04 17:29:12 +02:00
Martin Geisler
a3eaeca212
Update scraper dependency (#547)
* Update scraper dependency to 0.15.0

No code changes required because of this.

* Update dependencies in lock file
2023-04-04 14:27:46 +02:00
dependabot[bot]
407fee286b
Bump spin from 0.9.6 to 0.9.8 (#545)
Bumps [spin](https://github.com/mvdnes/spin-rs) from 0.9.6 to 0.9.8.
- [Release notes](https://github.com/mvdnes/spin-rs/releases)
- [Changelog](https://github.com/mvdnes/spin-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mvdnes/spin-rs/commits)

---
updated-dependencies:
- dependency-name: spin
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-04 08:54:46 +02:00
dependabot[bot]
236fbc6f9e Bump openssl from 0.10.45 to 0.10.48
Bumps [openssl](https://github.com/sfackler/rust-openssl) from 0.10.45 to 0.10.48.
- [Release notes](https://github.com/sfackler/rust-openssl/releases)
- [Commits](https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.45...openssl-v0.10.48)

---
updated-dependencies:
- dependency-name: openssl
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-25 10:41:50 +00:00
Andrew Walbran
f5b6e47f31 Put tinyvec example inline. 2023-03-23 15:06:23 +00:00
Andrew Walbran
f293ede958 Add page about tinyvec. 2023-03-23 15:06:23 +00:00
Andrew Walbran
56319e016b Add page about buddy_system_allocator. 2023-03-23 15:06:23 +00:00
Andrew Walbran
dc95bd1dae Write page about zerocopy. 2023-03-23 15:06:23 +00:00
Dustin J. Mitchell
ba28dd2d4c
Parse Markdown in mdbook-xgettext (#449)
* Parse Markdown to support translation.

This upgrades from just splitting Markdown files on double-newlines, to
using a Markdown parser to break them into more appropriate chunks. The
upshot is that code samples are all in one message, lists are bundled
together, and generally it should be easier to translate.

* [WIP] helper to update po files for new translation

* process synthetic input file-by-file

* review comments

* remove temporary code

* fix msgfmt lints
2023-03-07 18:07:07 +00:00
Jooyung Han
1821a3fd12
Make i18n-helpers a requirement (#461)
* Make i18n-helpers a requirement

* Skip mdbook-gettext for mdbook-xgettext

* Gettext finds PO file based on `book.language`

* Update workflow

No need to set `preprocessor.gettext.po-file`.

---------

Co-authored-by: Jooyung Han <jooyung@google.com>
2023-02-28 22:05:09 +09:00
Andrew Walbran
20f02db5f5
Add a cargo workspace containing both crates (#321)
* Move Cargo.toml for exercises to exercises directory.

* Create a workspace with both exercises and i18n-helpers.

* Build in CI as well as testing.

* Binaries must have a main function.

* No need for workspaces configuration for caching anymore.
2023-02-02 16:14:34 +00:00
dependabot[bot]
0b7357a32d
Bump tokio from 1.23.0 to 1.24.1
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.23.0 to 1.24.1.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.23.0...tokio-1.24.1)

---
updated-dependencies:
- dependency-name: tokio
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-06 22:02:55 +00:00
Martin Geisler
6f49dcf2fe Add Cargo.lock
This captures a set of known-good dependencies for the provided
solutions.
2023-01-03 14:42:33 +01:00