Skip to content

Commit 249ad44

Browse files
committed
docs(exercises): updated all exercises readme files
all exercises readme files now have a unified structure and a description
1 parent 54804e3 commit 249ad44

File tree

20 files changed

+85
-54
lines changed

20 files changed

+85
-54
lines changed

exercises/clippy/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
### Clippy
1+
# Clippy
22

33
The Clippy tool is a collection of lints to analyze your code so you can catch common mistakes and improve your Rust code.
44

55
If you used the installation script for Rustlings, Clippy should be already installed.
66
If not you can install it manually via `rustup component add clippy`.
77

8-
For more information about Clippy lints, please see [their documentation page](https://rust-lang.github.io/rust-clippy/master/).
8+
## Further information
9+
10+
- [GitHub Repository](https://github.com/rust-lang/rust-clippy).

exercises/collections/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### Collections
1+
# Collections
22

33
Rust’s standard library includes a number of very useful data
44
structures called collections. Most other data types represent one
@@ -17,4 +17,6 @@ structures that are used very often in Rust programs:
1717
You may also know this by the names [*unordered map* in C++](https://en.cppreference.com/w/cpp/container/unordered_map),
1818
[*dictionary* in Python](https://docs.python.org/3/tutorial/datastructures.html#dictionaries) or an *associative array* in other languages.
1919

20-
[Rust book chapter](https://doc.rust-lang.org/stable/book/ch08-01-vectors.html)
20+
## Further information
21+
22+
- [Storing Lists of Values with Vectors](https://doc.rust-lang.org/stable/book/ch08-01-vectors.html)

exercises/conversions/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
### Type conversions
2-
1+
# Type conversions
32

43
Rust offers a multitude of ways to convert a value of a given type into another type.
54

@@ -15,6 +14,8 @@ Furthermore, the `std::str` module offers a trait called [`FromStr`](https://doc
1514

1615
These should be the main ways ***within the standard library*** to convert data into your desired types.
1716

18-
#### Book Sections
17+
## Further information
1918

20-
These are not directly covered in the book, but the standard library has great documentation for [conversions here](https://doc.rust-lang.org/std/convert/index.html). The `FromStr` trait is also covered [here](https://doc.rust-lang.org/std/str/trait.FromStr.html).
19+
These are not directly covered in the book, but the standard library has a great documentation for it.
20+
- [conversions](https://doc.rust-lang.org/std/convert/index.html)
21+
- [`FromStr` trait](https://doc.rust-lang.org/std/str/trait.FromStr.html)

exercises/enums/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
### Enums
1+
# Enums
22

33
Rust allows you to define types called "enums" which enumerate possible values.
44
Enums are a feature in many languages, but their capabilities differ in each language. Rust’s enums are most similar to algebraic data types in functional languages, such as F#, OCaml, and Haskell.
55
Useful in combination with enums is Rust's "pattern matching" facility, which makes it easy to run different code for different values of an enumeration.
66

7-
#### Book Sections
7+
## Further information
88

99
- [Enums](https://doc.rust-lang.org/book/ch06-00-enums.html)
1010
- [Pattern syntax](https://doc.rust-lang.org/book/ch18-03-pattern-syntax.html)

exercises/error_handling/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
For this exercise check out the sections:
2-
- [Error Handling](https://doc.rust-lang.org/book/ch09-02-recoverable-errors-with-result.html)
3-
- [Generics](https://doc.rust-lang.org/book/ch10-01-syntax.html)
1+
# Error handling
2+
Most errors aren’t serious enough to require the program to stop entirely.
3+
Sometimes, when a function fails, it’s for a reason that you can easily interpret and respond to.
4+
For example, if you try to open a file and that operation fails because the file doesn’t exist, you might want to create the file instead of terminating the process.
45

5-
of the Rust Book.
6+
## Further information
67

7-
or alternatively, check out the sections:
8+
- [Error Handling](https://doc.rust-lang.org/book/ch09-02-recoverable-errors-with-result.html)
9+
- [Generics](https://doc.rust-lang.org/book/ch10-01-syntax.html)
810
- [Result](https://doc.rust-lang.org/rust-by-example/error/result.html)
911
- [Boxing errors](https://doc.rust-lang.org/rust-by-example/error/multiple_error_types/boxing_errors.html)
10-
11-
of the Rust By Example Book.

exercises/functions/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
### Functions
1+
# Functions
22

33
Here, you'll learn how to write functions and how Rust's compiler can trace things way back.
44

5-
#### Book Sections
5+
## Further information
66

77
- [How Functions Work](https://doc.rust-lang.org/book/ch03-03-how-functions-work.html)

exercises/generics/README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
### Generics
1+
# Generics
22

3-
In this section you'll learn about saving yourself many lines of code with generics!
3+
Generics is the topic of generalizing types and functionalities to broader cases.
4+
This is extremely useful for reducing code duplication in many ways, but can call for rather involving syntax.
5+
Namely, being generic requires taking great care to specify over which types a generic type is actually considered valid.
6+
The simplest and most common use of generics is for type parameters.
47

5-
### Book Sections
8+
## Further information
69

710
- [Generic Data Types](https://doc.rust-lang.org/stable/book/ch10-01-syntax.html)
811
- [Bounds](https://doc.rust-lang.org/rust-by-example/generics/bounds.html)

exercises/if/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
### If
1+
# If
22

33
`if`, the most basic type of control flow, is what you'll learn here.
44

5-
#### Book Sections
5+
## Further information
66

77
- [Control Flow - if expressions](https://doc.rust-lang.org/book/ch03-05-control-flow.html#if-expressions)

exercises/macros/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
### Macros
1+
# Macros
22

33
Rust's macro system is very powerful, but also kind of difficult to wrap your
44
head around. We're not going to teach you how to write your own fully-featured
55
macros. Instead, we'll show you how to use and create them.
66

7-
#### Book Sections
7+
## Further information
88

99
- [Macros](https://doc.rust-lang.org/book/ch19-06-macros.html)
1010
- [The Little Book of Rust Macros](https://danielkeep.github.io/tlborm/book/index.html)

exercises/modules/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
### Modules
1+
# Modules
22

33
In this section we'll give you an introduction to Rust's module system.
44

5-
#### Book Sections
5+
## Further information
66

77
- [The Module System](https://doc.rust-lang.org/book/ch07-02-defining-modules-to-control-scope-and-privacy.html)

0 commit comments

Comments
 (0)