1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-02-04 18:36:01 +02:00

23 Commits

Author SHA1 Message Date
Martin Geisler
1b3984df20
Move Mockall and GoogleTest slides to Android section (#1533)
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.
2024-03-04 16:25:35 +01:00
Nicole L
f5f2c6b925
Binder/AIDL content updates (#1618) 2024-02-09 15:11:10 -08:00
Martin Geisler
1f6c0ea8a6
Remove double "finally" in java.md (#1732) 2024-01-22 11:15:06 -08:00
Martin Geisler
c9f66fd425
Format all Markdown files with dprint (#1157)
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.
2023-12-31 00:15:07 +01:00
Ning Chen
2fc3ddc34d
Add adb root for service deployment (#1550)
Otherwise
```
$ adb shell /data/local/tmp/birthday_server
thread 'main' panicked at birthday_service/src/server.rs:16:10:
Failed to register service: PERMISSION_DENIED
```
2023-12-21 14:29:18 +01:00
Ning Chen
01b4b28ff8
Link statically to avoid dynamic link error (#1544)
```
$ adb shell /data/local/tmp/hello_rust_with_dep
CANNOT LINK EXECUTABLE "/data/local/tmp/hello_rust_with_dep": library "libtextwrap.dylib.so" not found: needed by main executable
```
2023-12-21 14:27:14 +01:00
Ning Chen
a9eaa129cf
Add safety comment (#1553)
```
error: unsafe block missing a safety comment
  --> interoperability/bindgen/main.rs:11:5
   |
11 |     unsafe {
   |     ^^^^^^^^
   |
   = help: consider adding a safety comment on the preceding line
   = help: for further information visit https://rust-lang.github.io/rust-clippy
/master/index.html#undocumented_unsafe_blocks
   = note: requested on the command line with `-D clippy::undocumented-unsafe-bl
ocks`
```
2023-12-21 14:26:25 +01:00
Lukasz Anforowicz
584c957d69
Fix spelling of CXX and Cargo (mostly in the Chromium part). (#1549) 2023-12-01 10:21:47 -08:00
Ning Chen
3f7b6d4ad7
Fix adb push command (#1542)
```
$ adb push "$ANDROID_PRODUCT_OUT/system/bin/hello_rust /data/local/tmp"
adb: push requires <source> and <destination> arguments
```

---------

Co-authored-by: Martin Geisler <mgeisler@google.com>
2023-12-01 10:05:46 +00:00
Ning Chen
ca0bfedac6
Update setup.md (#1519)
```
$ lunch aosp_cf_x86_64_phone-userdebug

Invalid lunch combo: aosp_cf_x86_64_phone-userdebug
Valid combos must be of the form <product>-<release>-<variant>
```
2023-11-30 13:36:42 +00:00
gurchetansingh
d2aab63d15
More speaker notes about Android (#1501)
Helps with https://github.com/google/comprehensive-rust/issues/1083
2023-11-28 19:19:04 +00:00
spoloxs
67d53d29a6
Update Android.bp files (#895)
Remove the `prefer_rlib` flags from all `Android.bp` files.

Solves issue #371
2023-11-08 16:56:29 -08: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
Martin Geisler
3c159d8af0
Add instructions for how to use build_all.sh (#1434) 2023-10-31 09:00:02 +01:00
Martin Geisler
debaca9f7f
Add speaker notes for CXX page (#1060)
While we don’t have slides showing how to use the crate (#823), we can
at least explain at a high level what the instructor should focus on
when walking through the tutorial.
2023-08-11 13:00:10 +02:00
Sharun
c564ca625f
remove $ from code-blocks in build_all.sh (#955)
* removed $ from code-blocks in build_all.sh

* separate the code from the output

* added shell indicator for the code block

* added shell indicator for the code block

* update logging.md

* separate the code from the output in other files as well

* update the output code-blocks to text
2023-07-12 16:31:16 +02:00
Sharun
f5764ad4bc
remove $ from code-blocks in other markdown files as well (#952)
* remove $ from code blocks in translations

* remove $ from code blocks in the other markdown files as well

* Revert "remove $ from code blocks in the other markdown files as well"

This reverts commit eda922dab93dd2d2967581650a5c983432ec3a80.

* remove $ from code blocks in setup.md

* re-added the previous changes

* revert logging.md
2023-07-10 21:25:41 -07:00
Yonghyun
2482fa3c56
Update build_all.sh (#678)
* Update build_all.sh

The path, $ANDROID_BUILD_TOP and/or $ANDROID_PRODUCT_OUT, can contain spaces, which results in error. As long as shell var is not number, it is safe to enclose it with ""

* Enclose full shell word in quotes

This is just a stylistic choice: I find it easier to parse a command line if the full shell word is in quotes.

---------

Co-authored-by: Martin Geisler <martin@geisler.net>
2023-05-25 08:51:12 +00:00
Andrew Walbran
b064642b02 Make program consistent with output given. 2023-01-24 11:45:04 +00:00
Andrew Walbran
536c1dc90b Speaker notes for Android chapter. 2023-01-24 11:45:04 +00:00
Andrew Pollack
e203586182
Minor punctuation update 2022-12-21 09:38:05 -08:00
Andrew Walbran
f3ff5b994b
Fix typo 2022-12-21 16:02:37 +00:00
Martin Geisler
c212a473ba Publish Comprehensive Rust 🦀 2022-12-21 16:38:28 +01:00