1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-04-23 16:12:47 +02:00

1334 Commits

Author SHA1 Message Date
Nicole L
e6bab6fd93
Remove pub from traits exercise (#2677) 2025-02-28 12:36:13 -08:00
Nicole L
611306a172
Add speaker note about UFCS (#2672) 2025-02-28 11:31:36 -08:00
Nicole L
526dddce72
Add speaker note about for and array refs (#2665) 2025-02-28 10:31:15 -08:00
Nicole L
a4469e7a91
Add division example to expression exercise (#2673) 2025-02-28 10:30:54 -08:00
Nicole L
fd6d4807a0
Add speaker note about reference equality (#2670) 2025-02-27 16:35:48 -08:00
Nicole L
5ab6fae9e9
Suppress warnings for elevator exercise (#2668) 2025-02-27 12:33:06 -08:00
Nicole L
8b04a6dcb0
Split complex enum initialization (#2667) 2025-02-27 12:32:28 -08:00
Nicole L
fdb0a398b1
Add note about struct field defaults (#2666) 2025-02-27 12:31:56 -08:00
Nicole L
df57606996
Use explicit range when slicing into string (#2664) 2025-02-27 12:29:44 -08:00
Nicole L
b4301e06c4
Add note that slices can't grow (#2663) 2025-02-27 12:29:03 -08:00
Nicole L
bf4e4e34ee
Change array initialization syntax (#2662) 2025-02-27 12:27:43 -08:00
Nicole L
0134c25df9
Add a note mentioning that semicolons exist (#2660) 2025-02-27 12:26:36 -08:00
Eric Githinji
ea53e3c935
Use dbg! instead of println! in day 3 & 4. (#2669)
Part of #2478 to clean up code blocks when all that is needed is a
trivial debug print statement.

Co-authored-by: Eric Githinji <egithinji@google.com>
2025-02-27 18:46:55 +00:00
Nicole L
241c28ed7e
Move unreachable! to speaker notes (#2628) 2025-02-26 12:22:13 -08:00
Nicole L
d7a88211ff
Update AIDL intermediates path (#2639)
---------

Co-authored-by: Martin Geisler <mgeisler@google.com>
2025-02-26 17:28:11 +00:00
Nicole L
e52f5ea9e3
Fix vendored crates path (#2638) 2025-02-26 09:17:49 -08:00
Nicole L
32a16c95dc
Add note about AIDL methods taking &self (#2641) 2025-02-26 09:17:22 -08:00
Nicole L
5f6b9333fa
Add Android.bp entries for googletest and mockall example tests (#2643) 2025-02-26 09:11:48 -08:00
Nicole L
4ee2337c63
Add missing static_libs dep for libbirthday example (#2640) 2025-02-26 09:07:36 -08:00
Nicole L
7f8596e9bc
Use jni_libs for JNI dependency (#2637) 2025-02-26 09:06:09 -08:00
Nicole L
a10b4e6e21
Reorder CXX build steps to show genrules first (#2642) 2025-02-26 09:05:36 -08:00
Dustin J. Mitchell
08c613326a
Remove confusing speaker note from Shared-References slide (#2659)
Dangling references are discussed later in the "Borrowing" segment.

Fixes #2656
2025-02-26 11:48:54 -05:00
Eric Githinji
1a64c9ba9a
Use dbg! instead of println! in Day 2. (#2657)
Part of #2478 to clean up code blocks when all that is needed is a
trivial debug print statement.

As mentioned in previous related PRs, in some places I've opted to
retain the use of println! because dbg! makes it less readable.

Co-authored-by: Eric Githinji <egithinji@google.com>
2025-02-25 21:12:06 +00:00
scubed2
32a8b4bf13
Use chopsticks and limit philosophers. (#2655)
Use chopstick to explain why 2 are needed to eat.
Limit async to 2 philosophers so they can deadlock in tokio.
(Tested with [3, 4, 5] philosophers and they all were able to run
without deadlock
with lock ordering disabled.)

---------

Co-authored-by: Sterling Stein <scubed2+git@gmail.com>
2025-02-24 16:13:16 +00:00
Eric Githinji
f531d4dfd7
Use dbg! instead of println! in Day 1 aft session (#2654)
Part of #2478 to clean up code blocks when all that is needed is a
trivial debug print statement.

In certain slides (8.1, 9.2, 9.3, 10.5) I've opted to retain the use of
println! because dbg! makes it less readable. The
dbg! macro uses pretty-printing by default and this results in a simple
array such as the one in 8.1 being printed vertically instead of a
cleaner one-liner.

Co-authored-by: Eric Githinji <egithinji@google.com>
2025-02-24 14:13:43 +00:00
Eric Githinji
0daab179e9
Use dbg! instead of println! in Day 1 mng session (#2652)
As mentioned in #2478, this cleans up the code blocks when all that is
needed is a trivial debug print statement.
Only making changes to Day 1 morning session so that I can get feedback
before proceeding with the rest of the course.

---------

Co-authored-by: Eric Githinji <egithinji@google.com>
2025-02-24 14:12:56 +00:00
Eric Githinji
49e4efcd9e
Split C interop slides into smaller slides. (#2645) 2025-02-22 19:48:10 +00:00
Frances Wingerter
63cc474ba0
closures/exercise.rs: drop trait bounds from struct definition (#2649)
This is more idiomatic than what we had before.

We keep the trait bounds for the inherent impl, because the new method
can use them to guide inference of unannotated closure arguments.
2025-02-20 21:51:39 +00:00
Frances Wingerter
e16dc70903
Clarify and correct closure syntax slide (#2647)
Simplify the example, adding demonstration of return type annotation and
removing confusing "lambda" reference from speaker notes.
2025-02-20 21:50:38 +00:00
Frances Wingerter
4f8b09009a
drop: avoid confusing names (#2648)
The Droppables are already named with letters, so hopefully referencing
the nesting order of blocks instead of giving them names is clearer.
2025-02-20 20:21:32 +00:00
Dustin J. Mitchell
44a79741ff
Be more consistent about tests vs. main (#2644)
The content slides all use `fn main`, with the exception of the testing
segment. But with this change, where it makes sense exercises use tests
instead, and not both tests and `fn main`.

A small change in `book.js` supports running tests when a code sample
does not have `fn main` but does have `#[test]`, so these work
naturally.

Fixes #1581.
2025-02-18 20:13:16 +00:00
Nicole L
699c5137c7
Remove nesting from let else example (#2600) 2025-02-11 10:45:04 -08:00
Nicole L
d732821edb
Fix note about undefined behavior (#2632) 2025-02-11 10:41:33 -08:00
Nicole L
d998022f75
Move use statements to beginning of widgets.rs (#2631) 2025-02-11 10:41:11 -08:00
Nicole L
f9aca3738a
Reorganize borrowck notes and add note about re-borrowing (#2635)
The speaker notes on the borrowck slide are a bit hard to read since
it's a big block of bulleted points. I've reorganized the notes to be a
bit easier to read by making some of the bullet points nested and by
moving some of the points to the "More to Explore" section. I've also
added a note on re-borrowing since students sometimes ask about it, and
I've added some playground links to demonstrate some of the points.
2025-02-07 17:05:27 -05:00
Nicole L
386757e697
Add note that borrock error can be triggered by direct mutation (#2629) 2025-02-07 11:15:00 -08:00
Nicole L
d603faca56
Add link to GridRefIter example (#2633) 2025-02-07 11:04:32 -08:00
Nicole L
c05f0b6f02
Add main method to code snippet (#2630)
The code snippet wouldn't compile/run directly because of a missing
`main` method.

Also remove unnecessary `&`.
2025-02-07 10:08:10 +01:00
Nicole L
f1459c54e1
Remove slide on shadowing (#2596) 2025-02-06 12:39:27 -08:00
Nicole L
72c7618cb4
Replace unimplemented with todo (#2594) 2025-02-06 12:35:28 -08:00
Nicole L
3229fc7c05
Fix tyop in speaker notes (#2627) 2025-02-06 11:01:19 -08:00
Nicole L
06bdb40442
Make code in expression evaluation exercise editable (#2601) 2025-02-06 11:00:46 -08:00
Nicole L
6a25d7be04
Minor whitespace changes (#2595) 2025-02-06 09:52:29 -08:00
Nicole L
e1ed6eaf47
Move struct update syntax to speaker notes (#2597) 2025-02-06 09:51:43 -08:00
Nicole L
ca137b4807
Move slide on blocks to beginning of control flow section (#2598) 2025-02-06 09:29:44 -08:00
Nicole L
553e3c5b10
Add slide reviewing irrefutable patterns (#2608) 2025-02-05 16:16:38 -08:00
Nicole L
28ab749338
Add "More to Explore" section to struct patterns slide (#2604) 2025-02-05 16:12:01 -08:00
Nicole L
afe206beab
Add division example to expression exercise (#2605) 2025-02-05 16:11:42 -08:00
Nicole L
8f01344757
Add speaker note about multiple impl blocks (#2606) 2025-02-05 16:10:55 -08:00
Nicole L
12fb4379f7
Add speaker note with manual derive example (#2607) 2025-02-05 16:10:25 -08:00