1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2024-12-17 15:21:32 +02:00
Commit Graph

668 Commits

Author SHA1 Message Date
Martin Geisler
a2367b4d93
Use * foo: for list (#1025)
We could use an m-dash, but we're using `:` aligns with how the rest of the course is written.
2023-07-24 11:17:23 -07:00
Dominik Maier
2685d8ec0d
New is implied in square (#1010) 2023-07-24 08:10:47 -04:00
Shaurya Arora
f1058980e4
Update while-let-expressions.md (#1018)
Update code snippet description to use `v.into_iter()`
instead of `v.iter()` since the former is what's actually
used in the code snippet.
2023-07-23 21:02:20 -07:00
Martin Geisler
03bc5be016
Fix Godbolt typo (#1014) 2023-07-21 15:01:10 -07:00
Dominik Maier
6e367132ad
Remove unneeded macro from Enum Sizes slide (#1015)
* Remove unneeded macro from Enum Sizes slide

* Update src/enums/sizes.md

---------

Co-authored-by: Martin Geisler <martin@geisler.net>
2023-07-21 10:23:30 -04:00
Dominik Maier
bd4839e394
Refer to Godbolt (#1011)
* Refer to Godbolt

* Apply suggestions from code review

---------

Co-authored-by: Martin Geisler <martin@geisler.net>
2023-07-20 15:46:50 +00:00
Martin Geisler
d4c08e6c9d
Remove statement that data is moved when assigning (#982)
* Remove statement that data is moved when assigning

The distinction between non-`Copy` and `Copy` types is tricky to explain. One problem is that people often focus on _moving_ vs _copying_ when both variable types always copy data.

This PR removes the statement about moving data (since that is wrong on its own).

* Apply suggestions from code review

Co-authored-by: Dustin J. Mitchell <djmitche@google.com>

* Apply suggestions from code review

Co-authored-by: Dustin J. Mitchell <djmitche@google.com>

---------

Co-authored-by: Dustin J. Mitchell <djmitche@google.com>
2023-07-18 08:52:26 -07:00
Dominik Maier
486458c72d
Memory Management: Rework Scope-based Cons (#998)
* Memory Management: Add classic ARC issues to Comparison

* replaced uaf reference (which needs misuse in C++)
2023-07-18 08:51:52 -07:00
Martin Geisler
cb45d322c7
Make installation URL more prominent (#1006)
* Make installation URL more prominent

This makes it more prominent that people should go to rustup.rs to install Rust.
2023-07-18 11:37:57 +00:00
Dominik Maier
2c3aa82af5
Filesystem slide rework (#1002)
* Filesystem slide rework (2015 is over)

* cleanup

* Cleanup text

* Specify "current versions"

Co-authored-by: Martin Geisler <martin@geisler.net>

---------

Co-authored-by: Martin Geisler <martin@geisler.net>
2023-07-18 13:32:45 +02:00
Martin Geisler
94e5db7ddb
Fix capitalization of Rust (#1007) 2023-07-18 12:41:27 +02:00
Dominik Maier
2f86a259b6
Add Mutex information to Rc slide (#1001)
Add mutex information to Rc slide
2023-07-18 11:03:45 +02:00
Dominik Maier
0411d0c8e5
Additional sentence for derive macros (#1003) 2023-07-18 11:02:49 +02:00
Dominik Maier
640be0770a
Equal -> Equals for consistency (#1004)
* Equal -> Equals for consistency

* forgot one
2023-07-18 11:02:35 +02:00
Dominik Maier
46a38bc67a
Error is not yet available in core on stable (#1005) 2023-07-18 11:02:24 +02:00
Dominik Maier
ebbb696703
Rename confusing 'Double Free' (#1000) 2023-07-17 22:42:35 -07:00
Dominik Maier
797260b813
Use non-generic default (#999) 2023-07-17 22:38:48 -07:00
Dominik Maier
3f1a8d8ca1
Memory Management: Leaks are bad, RCE is worse (#997)
Leaks are bad, RCE is worse
2023-07-17 22:36:14 -07:00
Dominik Maier
aabe0c0a96
'Stack Memory' slide isn't really showing stack memory (#996) 2023-07-17 22:35:20 -07:00
Dominik Maier
cb689be312
Static variables don't need unsafe (#995) 2023-07-17 22:23:03 -07:00
Dominik Maier
21ea796e3b
Move to more legible types (#989)
* Move to more legible types

* Add information about underscores
2023-07-17 22:12:51 -07:00
Dominik Maier
97ac01dc75
Rust isn't functional, but it does have functional elements (#987)
* Rust isn't functional, but it does have functional elements

* End sentence

Co-authored-by: Martin Geisler <martin@geisler.net>

* add info about OO

---------

Co-authored-by: Martin Geisler <martin@geisler.net>
2023-07-18 01:13:06 +02:00
Dominik Maier
e7253e2b5e
Updated 'Using Cargo' (#984) 2023-07-17 23:26:39 +02:00
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