1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2024-12-16 14:53:28 +02:00
Commit Graph

635 Commits

Author SHA1 Message Date
eepeep
eda4766442
Fix some broken fragment ID encodings in rustdoc links (#571) 2023-07-14 08:55:46 +00:00
Victor Costan
ef99d15529
Fix solution in Link Checker in Concurrency Morning exercises (#904)
* Fix solution in Link Checker in Concurrency Morning exercises.

This change fixes the following issues with the current solution:

1. It is not listed on the "solutions" page.
2. It is not multi-threaded and does not use channels.

---------

Co-authored-by: Dustin J. Mitchell <djmitche@google.com>
2023-07-13 10:52:06 +02:00
Frances Wingerter
abb05164da
Clarify a couple minor points (#912)
* compound types: disambiguate that length is not 'same'

* basic syntax: clarify preference for consts and quickly justify unsafety of static mut

* basic-syntax: take review feedback into account on consts/statics

* basic-syntax: be careful not to call `const` defns variables

variables in rust are `place`s in a formal sense and name objects in an informal one; `const` merely abbreviates an expression
2023-07-12 18:37:49 +01:00
Martin Geisler
6d736d69c4
Fix typo in enums.md (#958)
From #779.
2023-07-12 09:43:02 -07: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
Frances Wingerter
2f5dcbafc3
Rework health statistics exercise (#909)
* exercises: health-statistics: weight -> height

weight may be a sensitive topic for some readers; use height instead as this isn't important to the content of the course

* exercises: health-statistics: add health report

this lets us see a non-setter use case for &mut self

it also makes the 'statistics' side of this exercise more explicit as we count doctor visits

* exercises: health-statistics: normalize variable names
2023-07-11 18:01:49 -04: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 eda922dab9.

* remove $ from code blocks in setup.md

* re-added the previous changes

* revert logging.md
2023-07-10 21:25:41 -07:00
Erdem
427aab110f
Adds a comment for an iterator based implementation for Polygon::length (#950)
Outlines an alternative implementation for Polygon::length.  This exercise is aimed at novice users and we want to keep the implementation simple. For users familiar with iterator concepts this comment points to an alternative.
2023-07-10 22:55:33 +00:00
Dustin J. Mitchell
88510e9e72
fix links for IntoIterator for Vec (#917) 2023-07-07 09:27:35 -04:00
Frances Wingerter
dd9047126c
A few improvements to control flow section (#907)
* control-flow: blocks: clarify prose around block values/types

specify what determines the type of a block

move the last expression note to the discussion of blocks rather than functions to clarify that it applies to both

* control-flow: if-let: correct sense of 'non-returning'
2023-07-06 17:23:02 +00:00
Martin Geisler
bd98a829c6
Fix typo in try-operator.md (#916) 2023-07-06 15:25:37 +01:00
Martin Geisler
02359573a4
Fix unclear wording in default.md (#915) 2023-07-06 15:25:16 +01:00
Martin Geisler
e199aee30d
Rephrase awkward sentence in rc.md (#906) 2023-07-06 15:03:06 +02:00
Frances Wingerter
9567f16d75
Fix some typos and wording in welcome.md (#639) 2023-07-06 09:38:43 +00:00
Frances Wingerter
7f03a67a6a
Rename 'designing a library' example (#911)
rename 'designing a library' example

library design in Rust is its own topic that this course does not cover; to avoid confusion, let's stick to describing things in terms of books
2023-07-06 08:40:47 +00:00
Frances Wingerter
8df1d74e73
Fix some minor typos (#910)
* aspect-ratio-helper.py: fix typo

* basic syntax: make 'bits' plural in all occurrences
2023-07-06 08:39:47 +00:00
Frances Wingerter
a290a18065
Mention generic data structures as well as algorithms (#908)
generics: mention generic data structures as well as algorithms
2023-07-06 08:39:28 +00:00
Wojtek Marczenko
4413b6a28f
Update C manual memory management example (#902)
In C (as opposed to C++) the explicit cast from void* to int* is not required. It is also not idiomatic to do so in C code.

Actual C codebase would use `malloc()` without the cast, and a C++ one (when not using abstractions) a `new int[n]` - both a bit cleaner and less verbose than this example.
2023-07-05 09:37:07 -04:00
Martin Geisler
d27daceda2
Small improvement to wording in box-recursive.md (#905)
The "it" was not clear to our Localization team so I tried to make the sentence a little clearer.
2023-07-05 09:36:07 -04:00
Martin Geisler
d0223ad98b
Mention panics vs wrap-around for integer overflows (#901)
Fixes #894
2023-07-04 11:31:16 +01:00
Victor Costan
6df4ba24dd
Clarify that each philosopher should think/eat 100 times (#900)
Clarify that each philosopher should think/eat 100 times.

Folks who have hazy memories of the philosopher dining problem may
interpret the original instructions as "make each philosopher think and
eat once". This interpretation loses a critical detail, because the
resulting code is highly unlikely to deadlock in practice, even without
breaking the symmetry.
2023-07-04 06:41:54 +00:00
Matt Schulte
76ee72f8e0
Suggest to run day 3 afternoon exercise locally (#882)
* Suggest to run day 3 afternoon exercise locally

Based on feedback from running the class, students found developing
the day 3 afternoon exercise locally was a better experience than
using Playground.

* Update src/exercises/day-3/afternoon.md

---------

Co-authored-by: Martin Geisler <martin@geisler.net>
2023-07-03 06:36:38 +00:00
Mauve
9fc92c5d66
Tweak speaker note about move closures and FnOnce (#859)
* Tweak speaker note about move closures and FnOnce

* Expand closure example, explain move

* Explicitly state traits of example closures
2023-07-03 08:35:03 +02:00
Victor Costan
0c867c952f
"Strings and Iterators" solution that uses let-else (#833)
Add "Strings and Iterators" solution that uses let-else.
2023-06-29 08:52:58 +02:00
Chiin
753e53ad17
Correct print statement in library exercise (#876)
* fix(day 1): correct print statement logic for library emptiness status

* chore: add explicit method print

* chore: change `:` for `->`
2023-06-27 08:22:50 +00:00
Victor Costan
0b4891fb1f
Unified FFI setup for for readdir() on macOS (#857)
Unified FFI setup for for readdir() on macOS.
2023-06-23 15:48:18 +02:00
Martin Geisler
eb6850a1d0
Clarify what "it" is in rust.md (#855) 2023-06-22 14:28:14 +00:00
Martin Geisler
b7469f779e
Update if-let-expressions.md (#854)
The use of "interesting" here made the sentence unclear to our Localization team.
2023-06-22 16:27:34 +02:00
Martin Geisler
aba7fd7f56
Simplify error handling pages (#851)
This makes the `use` statements more consistent and shortens some
variable names.
2023-06-22 16:27:06 +02:00
Martin Geisler
5e42cc3548
Clarify wording in lifetimes.md (#853) 2023-06-22 13:47:27 +01:00
Martin Geisler
186d333227
Run builds on both Mac OS and Linux (#830)
* Run builds on both Mac OS and Linux

This would have helped us catch #570.

* Fix MacOS CI (#848)

* Revert unnecessary changes

The changes might be good, but I want to keep this PR small and
focused. If we end up with the extra `cfg` statements, we should
include a comment to let students know what they do: we’re targeting
people new to Rust, so we need to be careful with explanations.

---------

Co-authored-by: Dominik Maier <domenukk@gmail.com>
2023-06-22 10:38:41 +02:00
Yonghyun
da569cd7c4
Update default-methods.md (#747)
* Update default-methods.md

This commit resolves two issues.

a) typo: Equal -> Equals
b) update details to comply w/ example source code

* Update src/traits/default-methods.md

Co-authored-by: Edward Liaw <edliaw@google.com>

---------

Co-authored-by: Martin Geisler <martin@geisler.net>
Co-authored-by: Edward Liaw <edliaw@google.com>
2023-06-22 09:05:11 +02:00
Andrew Walbran
c1ad97c659
Fix example to build and run (#838) 2023-06-21 09:48:05 +01:00
vanyabrucker
1ed40f4746
Corrected spelling in bounded.md (#844)
Corrected spellling  bounded.md
2023-06-21 07:12:59 +00:00
Victor Costan
b2ebd8848c
Document the historical reference in the newtypes example (#826)
Document the historical reference in the newtypes example.
2023-06-18 14:37:57 +02:00
Md. Rasel Mandol
5d56a529da
Bengali translation: to link incomplete Bengali translation (#819)
Bengali translation: to link incomplete Bengali translation
2023-06-14 19:37:22 +01:00
Andrew Walbran
54fd2578d3
Add pages about entry point and exception handling on APs (#802)
* Add page about entry point before Rust code.

* Convert tabs to spaces.

mdbook doesn't seem to handle tabs in code properly.

* Add page about handling exceptions.

* More nuanced discussion of Rust Raspberry Pi OS tutorial.

* Add note about EL1 to entry point page too.
2023-06-14 18:27:07 +00:00
Martin Geisler
53fff52b60
Fix link to LICENSE in credits.md (#813)
The link worked fine when GitHub was rendering it — it rewrites the relative path correctly. However, when viewed as the output of `mdbook`, the link pointed to nowhere.
2023-06-14 10:17:29 +01:00
Martin Geisler
d71ea715bb
Fix broken link in for-expressions.md (#812) 2023-06-13 17:43:08 +00:00
Martin Geisler
7c9195ba7a
Fix broken link in Pitfalls of async/await (#811)
Fix broken link in Async Pitfalls
2023-06-13 17:26:56 +00:00
LIU JIE
cf0ce5c0b2
Explain iff in mutex.md (#810)
---------

Co-authored-by: Martin Geisler <martin@geisler.net>
2023-06-13 12:56:42 +00:00
Martin Geisler
9cf55893ac
Rephrase when send blocks (#792)
* Rephrase when `send` blocks

From a discussion with @hueich in #786: https://github.com/google/comprehensive-rust/pull/786#discussion_r1224850499.
2023-06-11 13:20:33 +00:00
Andreas Hindborg
56c1a6e55e
Add suggestion to use rustup doc (#770)
Suggest to use `rustup doc std::fmt` to open the documentation for `std::fmt`.
2023-06-10 18:01:57 -04:00
Roman
4074b72df8
Fix typo in borrowing.md (#790) 2023-06-10 13:31:46 +00:00
Richard Penman
07a7380b13
Update sizes.md (#775) 2023-06-09 18:00:33 +00:00
Mauve
4b7b5d83ea
Make chat-client reads cancellation safe (#713)
* Make chat-client reads cancellation safe

* Update chat-app references
2023-06-09 16:35:52 +02:00
Mauve
6bf60dadc8
Add information about async cancellation (#716)
* Mention cancellation via select!

* Add a section on async cancellation

* Update cancellation slide, rework example

* Rework select! note about cancellation

* Collapse cancellation comparision to panic and ?

* Don't keep null bytes from incomplete reads
2023-06-09 11:59:12 +02:00
Gershon Papi
305bdbb29a
Fix slices immutable example (#686) 2023-06-06 09:17:55 +00:00
rbehjati
7257052f0c
Minor fixes in async (#771) 2023-06-05 17:12:00 +01:00
TPReal
a7bef92b36
Mentioned the XKCD source of the joke in enums.md (#748)
XKCD is under CC BY-NC 2.5 licence, so it is fair to at least link to the source when reusing a joke.
2023-06-01 18:54:41 +00:00