Dhghomon
e09e309f06
Merge pull request #42 from elfsternberg/L7104-type-correction
...
This block describes the typing incorrectly.
4 years ago
Dhghomon
38ac7cceef
Merge pull request #41 from patahene/patch-1
...
Fix an example output
4 years ago
Dhghomon
c01835408a
Merge pull request #40 from Zyfarok/master
...
Fix shadowing example
4 years ago
Elf M. Sternberg
e654c7d8e5
This block is confused.
...
Consider the following demonstration (this code compiles under Rust 2018
as a drop in for the contents of main.rs after `cargo new mapdemo --bin;
cargo run`):
```
fn main() {
let x = [1, 2, 3, 4, 5];
let z = x.iter().map(|&x| format!("{}", x)).collect::<Vec<String>>();
println!("{:?}", z);
}
```
The `self` argument to map will be an `Iter<u64>`. The `Self::Item`
type is therefore `u64`. The return type of the function being passed
to map is `String`. This is what the `B` type variable indicates: the
return type of the function, as can be clearly seen in the second line
of the `where` clause in your example:
```
F: FnMut(Self::Item) -> B
```
4 years ago
patahene
f592f662e4
Update README.md
4 years ago
Zyf
3b8d5057d6
Fix shadowing example
4 years ago
Arcadie
583281f2d5
Use emojis to ignore snippets that won't compile / code fragments.
...
I did a search and replace for:
// (note: this will not compile) incomplete code snippet -> // ⚠️
// (note: this will not compile) -> // 🚧
Note: Requires md2src version 1.1.0 or later!
4 years ago
Dhghomon
cddf839e32
Default + builder pattern
4 years ago
Arcadie
192047be94
Delete whitespace, tweak phrasing
4 years ago
Arcadie
9e9bf0a265
Arc: when spanwing threads in a loop, call join on handlers at the end
4 years ago
Arcadie
27def910d6
Mutex: fix output for code samples
4 years ago
Arcadie
a1f511f80f
Generics - fix print with, specify variables of type U
4 years ago
Arcadie
c56888fcf5
VecDeque - say items are moved instead of copied on remove()
4 years ago
Dhghomon
0dc4a75139
chars, len(), chars().count()
4 years ago
Arcadie
e773c679bd
Impl Trait - make snippets compile by fixing ignore message
4 years ago
Arcadie
3263dce437
Fix small typo in filter_map() example, get rid of into_iter() for range.
...
Range already implements Iterator trait, so no need for the into_iter().
4 years ago
Dhghomon
fafdb36cec
Rewrite a bit
4 years ago
Dhghomon
613a9755f0
impl Trait
4 years ago
Dhghomon
36a056df85
Closures in functions
4 years ago
Dhghomon
8fb5b1e131
Explanation of what a snippet is
4 years ago
Alexander Willner
8c0d7a3b79
getting all code snippets to compile or to be skipped
4 years ago
Alexander Willner
27f0d7ad45
getting the first 50 code snippets to compile or to be skipped
4 years ago
Alexander Willner
6f0ed2ae75
Started to get snippets compile / mark them as uncompilable...
4 years ago
Alexander Willner
1cf4605343
Mark snippet as no compilable
4 years ago
Dhghomon
a39f09850a
Some other methods
4 years ago
Dhghomon
56afb860af
.cycle()
4 years ago
Dhghomon
33705b94ba
.find(), .position()
4 years ago
Dhghomon
b62700abae
.any(), .all()
4 years ago
Dhghomon
ef187d51ba
.and_then(), .and()
4 years ago
Dhghomon
e9fdd53a7e
ok_or + ok_or_else
4 years ago
Dhghomon
4ac9f67713
Fix typo
4 years ago
Dhghomon
c4cb3c1ac1
More on closures + iterators
4 years ago
Dhghomon
516556fb5f
VecDeque
4 years ago
Dhghomon
9f9c7484c7
BinaryHeap
4 years ago
Dhghomon
e7f9b6d27c
Start HashSet + BTreeSet
4 years ago
Suresh G
e2ffd92ff1
Update README.md
...
spell changes
4 years ago
Dhghomon
17a9c09880
[] vs. .get() for HashMap
4 years ago
Dhghomon
6ccb798ce3
More on hashmaps
4 years ago
byschii
1f59c6b710
Typo
4 years ago
Dhghomon
3851cb54b9
Typo
4 years ago
Dhghomon
218a193dcf
Typo
4 years ago
Dhghomon
8e316f7402
More on r# and unicode escape
4 years ago
Dhghomon
75eb5a9194
correction
4 years ago
Dhghomon
3b337b533a
Add intro
4 years ago
Pradeep Chauhan
4d3f5a1c08
Merge branch 'master' into fix-typos
4 years ago
Pradeep Chauhan
4ee6006e8c
Fix typos
4 years ago
Dhghomon
b23782290f
.zip() and .collect() into HashMap
4 years ago
Dhghomon
6243d39632
Start HashMap
4 years ago
Dhghomon
4ea46d54d8
Commas in structs
4 years ago
Dhghomon
f78d86b5c9
More on printing
4 years ago