Merge pull request #1454 from ahresse/ahresse/remove_trailing_spaces
fix: remove trailing spaces
This commit is contained in:
commit
6f84887f60
|
@ -1,6 +1,6 @@
|
||||||
# Hashmaps
|
# Hashmaps
|
||||||
A *hash map* allows you to associate a value with a particular key.
|
A *hash map* allows you to associate a value with a particular key.
|
||||||
You may also know this by the names [*unordered map* in C++](https://en.cppreference.com/w/cpp/container/unordered_map),
|
You may also know this by the names [*unordered map* in C++](https://en.cppreference.com/w/cpp/container/unordered_map),
|
||||||
[*dictionary* in Python](https://docs.python.org/3/tutorial/datastructures.html#dictionaries) or an *associative array* in other languages.
|
[*dictionary* in Python](https://docs.python.org/3/tutorial/datastructures.html#dictionaries) or an *associative array* in other languages.
|
||||||
|
|
||||||
This is the other data structure that we've been talking about before, when
|
This is the other data structure that we've been talking about before, when
|
||||||
|
|
|
@ -3,17 +3,17 @@
|
||||||
Lifetimes tell the compiler how to check whether references live long
|
Lifetimes tell the compiler how to check whether references live long
|
||||||
enough to be valid in any given situation. For example lifetimes say
|
enough to be valid in any given situation. For example lifetimes say
|
||||||
"make sure parameter 'a' lives as long as parameter 'b' so that the return
|
"make sure parameter 'a' lives as long as parameter 'b' so that the return
|
||||||
value is valid".
|
value is valid".
|
||||||
|
|
||||||
They are only necessary on borrows, i.e. references,
|
They are only necessary on borrows, i.e. references,
|
||||||
since copied parameters or moves are owned in their scope and cannot
|
since copied parameters or moves are owned in their scope and cannot
|
||||||
be referenced outside. Lifetimes mean that calling code of e.g. functions
|
be referenced outside. Lifetimes mean that calling code of e.g. functions
|
||||||
can be checked to make sure their arguments are valid. Lifetimes are
|
can be checked to make sure their arguments are valid. Lifetimes are
|
||||||
restrictive of their callers.
|
restrictive of their callers.
|
||||||
|
|
||||||
If you'd like to learn more about lifetime annotations, the
|
If you'd like to learn more about lifetime annotations, the
|
||||||
[lifetimekata](https://tfpk.github.io/lifetimekata/) project
|
[lifetimekata](https://tfpk.github.io/lifetimekata/) project
|
||||||
has a similar style of exercises to Rustlings, but is all about
|
has a similar style of exercises to Rustlings, but is all about
|
||||||
learning to write lifetime annotations.
|
learning to write lifetime annotations.
|
||||||
|
|
||||||
## Further information
|
## Further information
|
||||||
|
|
|
@ -4,7 +4,7 @@ Rust's macro system is very powerful, but also kind of difficult to wrap your
|
||||||
head around. We're not going to teach you how to write your own fully-featured
|
head around. We're not going to teach you how to write your own fully-featured
|
||||||
macros. Instead, we'll show you how to use and create them.
|
macros. Instead, we'll show you how to use and create them.
|
||||||
|
|
||||||
If you'd like to learn more about writing your own macros, the
|
If you'd like to learn more about writing your own macros, the
|
||||||
[macrokata](https://github.com/tfpk/macrokata) project has a similar style
|
[macrokata](https://github.com/tfpk/macrokata) project has a similar style
|
||||||
of exercises to Rustlings, but is all about learning to write Macros.
|
of exercises to Rustlings, but is all about learning to write Macros.
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# Options
|
# Options
|
||||||
|
|
||||||
Type Option represents an optional value: every Option is either Some and contains a value, or None, and does not.
|
Type Option represents an optional value: every Option is either Some and contains a value, or None, and does not.
|
||||||
Option types are very common in Rust code, as they have a number of uses:
|
Option types are very common in Rust code, as they have a number of uses:
|
||||||
- Initial values
|
- Initial values
|
||||||
- Return values for functions that are not defined over their entire input range (partial functions)
|
- Return values for functions that are not defined over their entire input range (partial functions)
|
||||||
|
|
|
@ -30,7 +30,7 @@ fn main() {
|
||||||
if results.len() != 10 {
|
if results.len() != 10 {
|
||||||
panic!("Oh no! All the spawned threads did not finish!");
|
panic!("Oh no! All the spawned threads did not finish!");
|
||||||
}
|
}
|
||||||
|
|
||||||
println!();
|
println!();
|
||||||
for (i, result) in results.into_iter().enumerate() {
|
for (i, result) in results.into_iter().enumerate() {
|
||||||
println!("thread {} took {}ms", i, result);
|
println!("thread {} took {}ms", i, result);
|
||||||
|
|
|
@ -433,8 +433,8 @@ started, here's a couple of notes about how Rustlings operates:
|
||||||
4. If an exercise doesn't make sense to you, feel free to open an issue on GitHub!
|
4. If an exercise doesn't make sense to you, feel free to open an issue on GitHub!
|
||||||
(https://github.com/rust-lang/rustlings/issues/new). We look at every issue,
|
(https://github.com/rust-lang/rustlings/issues/new). We look at every issue,
|
||||||
and sometimes, other learners do too so you can help each other out!
|
and sometimes, other learners do too so you can help each other out!
|
||||||
5. If you want to use `rust-analyzer` with exercises, which provides features like
|
5. If you want to use `rust-analyzer` with exercises, which provides features like
|
||||||
autocompletion, run the command `rustlings lsp`.
|
autocompletion, run the command `rustlings lsp`.
|
||||||
|
|
||||||
Got all that? Great! To get started, run `rustlings watch` in order to get the first
|
Got all that? Great! To get started, run `rustlings watch` in order to get the first
|
||||||
exercise. Make sure to have your editor open!"#;
|
exercise. Make sure to have your editor open!"#;
|
||||||
|
|
Loading…
Reference in New Issue