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

645 Commits

Author SHA1 Message Date
Dominik Maier
e59a87f0c0
Clarify constructors in the speaker notes for methods (#992) 2023-07-17 17:17:26 -04:00
Dominik Maier
ba403016b9
Add note about doc tests (#991) 2023-07-17 17:16:23 -04:00
Dominik Maier
4fe28011a0
Fix links to FromIterator, HashSet (#993) 2023-07-17 15:10:02 -04:00
Dominik Maier
165a6c8f79
Add reference to microcontrollers as target for rust (#986) 2023-07-17 19:01:21 +02:00
Dominik Maier
eb0150fb84
Remove the overly specific 40 years reference (#988) 2023-07-17 18:57:33 +02:00
Dominik Maier
9e825fbd59
Clarify the "Slices" question and fix the answer (#990)
Clarify the question and fix the answer
2023-07-17 16:32:49 +00:00
Dominik Maier
faab0e2ee6
Clarify that crates don't have to live on crates.io (#985) 2023-07-17 17:58:04 +02:00
Henri Fontana
75bc262983
Update translations.md (#979)
Update list of contributors for the pt-BR translation.
2023-07-17 08:49:19 -07:00
Martin Geisler
79ae681f78
Fix broken module example (#983)
The module is external, so it should not have curly braces.
2023-07-17 16:54:47 +02:00
Martin Geisler
677e1feae1
Disambiguate b in main_improved.rs (#977)
Based on #761.
2023-07-14 12:01:00 +01:00
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